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

fill op error message enhancement
revert-23830-2.0-beta
Wilber 5 years ago committed by GitHub
parent d37cd74033
commit a5bdf485d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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));
}

Loading…
Cancel
Save