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

Function KvApplyAdagradDecayShapeFn

tensorflow/core/ops/training_ali_ops.cc:348–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346)doc");
347
348static Status KvApplyAdagradDecayShapeFn(InferenceContext* c, bool sparse) {
349 ShapeHandle unused;
350 ShapeHandle s = ShapeOrHandleShape(c, 0); // var
351 TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 1), &s)); // accum
352 // AdagradDecayOptimizer & AdagradDecayOptimizerV2 has different shape
353 // of accum_decay_power. DO NOT check shape of input(2) here.
354 TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused)); // lr
355 TF_RETURN_IF_ERROR(c->WithRank(c->input(4), 0, &unused)); // decay_step
356 TF_RETURN_IF_ERROR(c->WithRank(c->input(5), 0, &unused)); // decay_rate
357 TF_RETURN_IF_ERROR(c->WithRank(c->input(6), 0, &unused)); // baseline
358 TF_RETURN_IF_ERROR(c->WithRank(c->input(7), 0, &unused)); // global_step
359 TF_RETURN_IF_ERROR(
360 HandleKvGradAndIndicesInputs(c, sparse, 8 /* grad_idx */, &s));
361 if (c->num_outputs() > 0) {
362 c->set_output(0, s);
363 }
364 return Status::OK();
365}
366
367#define REGISTER_OP_BY_NAME(name) \
368REGISTER_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