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

Function InferFtrlUpdateTensorDesc

oneflow/user/ops/model_update_ops.cpp:293–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293Maybe<void> InferFtrlUpdateTensorDesc(user_op::InferContext* ctx) {
294 const user_op::TensorDesc& model = ctx->InputTensorDesc("model", 0);
295 const Shape& shape = model.shape();
296 const user_op::TensorDesc& model_diff = ctx->InputTensorDesc("model_diff", 0);
297 CHECK_EQ_OR_RETURN(model_diff.shape(), shape)
298 << "Model Diff shape is not consistent with Weight shape. ";
299 const user_op::TensorDesc& accumulate = ctx->InputTensorDesc("accumulate", 0);
300 const user_op::TensorDesc& z = ctx->InputTensorDesc("z", 0);
301 JUST(CheckShapeLike(&accumulate, &model));
302 JUST(CheckShapeLike(&z, &model));
303 JUST(CheckLearningRateShape(ctx));
304 return Maybe<void>::Ok();
305}
306
307Maybe<void> InferFtrlUpdateDataType(user_op::InferContext* ctx) {
308 const user_op::TensorDesc& model = ctx->InputTensorDesc("model", 0);

Callers 1

Calls 3

CheckShapeLikeFunction · 0.70
CheckLearningRateShapeFunction · 0.70
shapeMethod · 0.45

Tested by

no test coverage detected