未验证 提交 5f524efe 编写于 作者: L lilong12 提交者: GitHub

modify error report message, test=develop (#26743)

上级 4561fc37
...@@ -25,15 +25,11 @@ class DGCMomentumOp : public MomentumOp { ...@@ -25,15 +25,11 @@ class DGCMomentumOp : public MomentumOp {
protected: protected:
void InferShape(framework::InferShapeContext* ctx) const override { void InferShape(framework::InferShapeContext* ctx) const override {
PADDLE_ENFORCE_EQ(ctx->HasInput("current_step"), true, OP_INOUT_CHECK(ctx->HasInput("current_step"), "Input", "current_step",
"current_step should be set."); "DGCMomentumOp");
PADDLE_ENFORCE_EQ(ctx->HasInput("nranks"), true, OP_INOUT_CHECK(ctx->HasInput("nranks"), "Input", "nranks", "DGCMomentumOp");
platform::errors::NotFound( OP_INOUT_CHECK(ctx->HasOutput("Grad_out"), "Output", "Grad_out",
"Input(nranks) of DGCMomentumOp is not found.")); "DGCMomentumOp");
PADDLE_ENFORCE_EQ(ctx->HasOutput("Grad_out"), true,
platform::errors::NotFound(
"Output(Grad_out) of DGCMomentumOp is not found."));
return MomentumOp::InferShape(ctx); return MomentumOp::InferShape(ctx);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册