diff --git a/paddle/fluid/operators/fill_op.cc b/paddle/fluid/operators/fill_op.cc index a13eff7f8da88917f49f4b26275071f816e5b235..d1d364f0dd47eecf7c93ac8dd6a78ba2d199242a 100644 --- a/paddle/fluid/operators/fill_op.cc +++ b/paddle/fluid/operators/fill_op.cc @@ -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>("shape"); context->SetOutputDim("Out", framework::make_ddim(shape)); }