未验证 提交 a5bdf485 编写于 作者: W Wilber 提交者: GitHub

fill op error message enhancement. test=develop (#23560)

fill op error message enhancement
上级 d37cd740
......@@ -44,8 +44,7 @@ class FillOp : public framework::OperatorWithKernel {
using framework::OperatorWithKernel::OperatorWithKernel;
void InferShape(framework::InferShapeContext* context) const override {
PADDLE_ENFORCE_EQ(context->HasOutput("Out"), true,
"Output(Out) of FillOp should not be null.");
OP_INOUT_CHECK(context->HasOutput("Out"), "Output", "Out", "Fill");
auto& shape = context->Attrs().Get<std::vector<int>>("shape");
context->SetOutputDim("Out", framework::make_ddim(shape));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册