MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / KvResourceApplyFtrlShapeFn

Function KvResourceApplyFtrlShapeFn

tensorflow/core/ops/training_ali_ops.cc:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133#undef REGISTER_OP_BY_NAME
134
135static Status KvResourceApplyFtrlShapeFn(InferenceContext* c, bool sparse) {
136 ShapeHandle unused;
137 ShapeHandle s = ShapeOrHandleShape(c, 0); // var
138 TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 1), &s)); // accum
139 TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 2), &s)); // linear
140 TF_RETURN_IF_ERROR(
141 HandleKvGradAndIndicesInputs(c, sparse, 3 /* grad_idx */, &s));
142 int idx = sparse ? 5 : 4;
143 TF_RETURN_IF_ERROR(c->WithRank(c->input(idx++), 0, &unused)); // lr
144 TF_RETURN_IF_ERROR(c->WithRank(c->input(idx++), 0, &unused)); // l1
145 TF_RETURN_IF_ERROR(c->WithRank(c->input(idx++), 0, &unused)); // l2
146 TF_RETURN_IF_ERROR(c->WithRank(c->input(idx++), 0, &unused)); // lr_power
147 if (c->num_outputs() > 0) {
148 c->set_output(0, s);
149 }
150 return Status::OK();
151}
152
153#define REGISTER_OP_BY_NAME(name) \
154REGISTER_OP(name) \

Callers

nothing calls this directly

Calls 7

ShapeOrHandleShapeFunction · 0.70
MergeMethod · 0.45
WithRankMethod · 0.45
inputMethod · 0.45
num_outputsMethod · 0.45
set_outputMethod · 0.45

Tested by

no test coverage detected