| 438 | } |
| 439 | |
| 440 | Maybe<void> InferRmsPropUpdateTensorDesc(user_op::InferContext* ctx) { |
| 441 | const user_op::TensorDesc& model = ctx->InputTensorDesc("model", 0); |
| 442 | |
| 443 | const Shape& shape = model.shape(); |
| 444 | const user_op::TensorDesc& model_diff = ctx->InputTensorDesc("model_diff", 0); |
| 445 | CHECK_EQ_OR_RETURN(model_diff.shape(), shape); |
| 446 | const user_op::TensorDesc& mean_square = ctx->InputTensorDesc("mean_square", 0); |
| 447 | JUST(CheckShapeLike(&mean_square, &model)); |
| 448 | JUST(CheckLearningRateShape(ctx)); |
| 449 | if (ctx->has_input("scale_by_tensor", 0)) { |
| 450 | const auto& scale_by_tensor = ctx->InputTensorDesc("scale_by_tensor", 0); |
| 451 | JUST(CheckScalarShape(&scale_by_tensor)); |
| 452 | } |
| 453 | if (ctx->Attr<bool>("centered")) { |
| 454 | CHECK_OR_RETURN(ctx->has_input("mean_gradient", 0)); |
| 455 | const user_op::TensorDesc& mean_gradient = ctx->InputTensorDesc("mean_gradient", 0); |
| 456 | JUST(CheckShapeLike(&mean_gradient, &model)); |
| 457 | } else { |
| 458 | CHECK_OR_RETURN(!ctx->has_input("mean_gradient", 0)); |
| 459 | } |
| 460 | return Maybe<void>::Ok(); |
| 461 | } |
| 462 | |
| 463 | Maybe<void> InferRmsPropUpdateDataType(user_op::InferContext* ctx) { |
| 464 | const user_op::TensorDesc& model = ctx->InputTensorDesc("model", 0); |
no test coverage detected