diff --git a/paddle/fluid/operators/sequence_ops/sequence_pool_op.h b/paddle/fluid/operators/sequence_ops/sequence_pool_op.h index 8fe68deca66aa69be32a276f78001aa5c5a3fb06..4dafaa2b6384475174f567fcee628c3e71730c26 100644 --- a/paddle/fluid/operators/sequence_ops/sequence_pool_op.h +++ b/paddle/fluid/operators/sequence_ops/sequence_pool_op.h @@ -42,14 +42,17 @@ class SequencePoolKernel : public framework::OpKernel { "Input(X) Tensor of SequencePoolOp " "does not contain LoD information.")); PADDLE_ENFORCE_LE(lod_level, 2UL, - "The lod level of input shall be no more than 2."); + platform::errors::InvalidArgument( + "The lod level of input shall be no more than 2.")); PADDLE_ENFORCE_GE( dims[0], /*batch size = */ static_cast(lod[lod_level - 1].size() - 1), - "The first dimension of Input(X) must be large than batch size."); + platform::errors::InvalidArgument( + "The first dimension of Input(X) must be large than batch size.")); if (lod_level > 1UL) { PADDLE_ENFORCE_EQ(lod[0][lod[0].size() - 1], lod[1].size() - 1, - "The input lod information is illegal."); + platform::errors::InvalidArgument( + "The input lod information is illegal.")); framework::LoD out_lod; out_lod.push_back(lod[0]); out->set_lod(out_lod);