From a5bdf485d58977ff94c115cb4846769c0dad16f4 Mon Sep 17 00:00:00 2001 From: Wilber Date: Thu, 9 Apr 2020 11:13:37 +0800 Subject: [PATCH] fill op error message enhancement. test=develop (#23560) fill op error message enhancement --- paddle/fluid/operators/fill_op.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/operators/fill_op.cc b/paddle/fluid/operators/fill_op.cc index a13eff7f8da..d1d364f0dd4 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)); } -- GitLab