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

Function ApplyAdamAsyncShapeFn

tensorflow/core/ops/training_ali_ops.cc:418–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416#undef REGISTER_OP_BY_NAME
417
418static Status ApplyAdamAsyncShapeFn(InferenceContext* c, bool sparse) {
419 ShapeHandle unused;
420 ShapeHandle s = ShapeOrHandleShape(c, 0); // var
421 TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 1), &s)); // m
422 TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 2), &s)); // v
423 TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused)); // beta1_power
424 TF_RETURN_IF_ERROR(c->WithRank(c->input(4), 0, &unused)); // beta2_power
425 TF_RETURN_IF_ERROR(c->WithRank(c->input(5), 0, &unused)); // lr
426 TF_RETURN_IF_ERROR(c->WithRank(c->input(6), 0, &unused)); // beta1
427 TF_RETURN_IF_ERROR(c->WithRank(c->input(7), 0, &unused)); // beta2
428 TF_RETURN_IF_ERROR(c->WithRank(c->input(8), 0, &unused)); // epsilon
429 TF_RETURN_IF_ERROR(
430 HandleGradAndIndicesInputs(c, sparse, 9 /* grad_idx */, &s));
431 if (c->num_outputs() > 0) {
432 c->set_output(0, s);
433 }
434 return Status::OK();
435}
436
437REGISTER_OP("ApplyAdamAsync")
438 .Input("var: Ref(T)")

Callers 1

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