| 245 | #undef REGISTER_OP_BY_NAME |
| 246 | |
| 247 | static Status ApplyAdagradDecayShapeFn(InferenceContext* c, bool sparse) { |
| 248 | ShapeHandle unused; |
| 249 | ShapeHandle s = ShapeOrHandleShape(c, 0); // var |
| 250 | TF_RETURN_IF_ERROR(c->Merge(s, ShapeOrHandleShape(c, 1), &s)); // accum |
| 251 | // AdagradDecayOptimizer & AdagradDecayOptimizerV2 has different shape |
| 252 | // of accum_decay_power. DO NOT check shape of input(2) here. |
| 253 | TF_RETURN_IF_ERROR(c->WithRank(c->input(3), 0, &unused)); // lr |
| 254 | TF_RETURN_IF_ERROR(c->WithRank(c->input(4), 0, &unused)); // decay_step |
| 255 | TF_RETURN_IF_ERROR(c->WithRank(c->input(5), 0, &unused)); // decay_rate |
| 256 | TF_RETURN_IF_ERROR(c->WithRank(c->input(6), 0, &unused)); // baseline |
| 257 | TF_RETURN_IF_ERROR(c->WithRank(c->input(7), 0, &unused)); // global_step |
| 258 | TF_RETURN_IF_ERROR( |
| 259 | HandleGradAndIndicesInputs(c, sparse, 8 /* grad_idx */, &s)); |
| 260 | if (c->num_outputs() > 0) { |
| 261 | c->set_output(0, s); |
| 262 | } |
| 263 | return Status::OK(); |
| 264 | } |
| 265 | |
| 266 | REGISTER_OP("ApplyAdagradDecay") |
| 267 | .Input("var: Ref(T)") |
no test coverage detected