diff --git a/paddle/fluid/operators/lod_rank_table_op.cc b/paddle/fluid/operators/lod_rank_table_op.cc index 7cbfbd03e1dcb4983863445f6a9cd2c9ee17a8b0..3d038722e12c3d06908bd3da30663645702d1f85 100644 --- a/paddle/fluid/operators/lod_rank_table_op.cc +++ b/paddle/fluid/operators/lod_rank_table_op.cc @@ -58,7 +58,9 @@ output operators. class LoDRankTableInferShape : public framework::InferShapeBase { public: void operator()(framework::InferShapeContext *context) const override { - PADDLE_ENFORCE(context->HasInput("X"), "LoDRankTable must have input X"); + PADDLE_ENFORCE_EQ( + context->HasInput("X"), true, + platform::errors::NotFound("LoDRankTable must have input X.")); } };