MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / CheckLearningRateShape

Function CheckLearningRateShape

oneflow/user/ops/model_update_ops.cpp:52–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52Maybe<void> CheckLearningRateShape(user_op::InferContext* ctx) {
53 if (ctx->has_input("learning_rate", 0)) {
54 const user_op::TensorDesc& learning_rate = ctx->InputTensorDesc("learning_rate", 0);
55 JUST(CheckScalarShape(&learning_rate));
56 }
57 return Maybe<void>::Ok();
58}
59Maybe<void> CheckLearningRateDataType(user_op::InferContext* ctx) {
60 if (ctx->has_input("learning_rate", 0)) {
61 const user_op::TensorDesc& learning_rate = ctx->InputTensorDesc("learning_rate", 0);

Calls 2

CheckScalarShapeFunction · 0.70
has_inputMethod · 0.45

Tested by

no test coverage detected