| 346 | )doc"); |
| 347 | |
| 348 | static 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) \ |
| 368 | REGISTER_OP(name) \ |
nothing calls this directly
no test coverage detected