diff --git a/paddle/fluid/operators/distributed_ops/split_ids_op.cc b/paddle/fluid/operators/distributed_ops/split_ids_op.cc index e1154343d6ab9275c06bd1c62ca31f0f98824dae..0fe8f58595f85d9525f17e0585e16f30a3a5360b 100644 --- a/paddle/fluid/operators/distributed_ops/split_ids_op.cc +++ b/paddle/fluid/operators/distributed_ops/split_ids_op.cc @@ -59,7 +59,7 @@ class SplitIdsOp : public framework::OperatorWithKernel { auto ids_dims = ctx->GetInputsDim("Ids"); if (ids_var_type == framework::proto::VarType::LOD_TENSOR) { PADDLE_ENFORCE_EQ( - ids_dims[0], 2, + ids_dims[0].size(), 2, platform::errors::InvalidArgument( "ShapeError: The dimensions of the 'split_ids' must be 2. " "But received split_ids's dimensions = %d, " diff --git a/paddle/fluid/operators/distributed_ops/split_ids_op.h b/paddle/fluid/operators/distributed_ops/split_ids_op.h index 0861346bfc267a00ae15f80698748eeb2ca8e1e7..8a3ebe6e258e57205bb46675060162e673c7b300 100644 --- a/paddle/fluid/operators/distributed_ops/split_ids_op.h +++ b/paddle/fluid/operators/distributed_ops/split_ids_op.h @@ -36,9 +36,11 @@ class SplitIdsOpKernel : public framework::OpKernel { const auto ids_vars = ctx.MultiInputVar("Ids"); - PADDLE_ENFORCE_GT(platform::errors::InvalidArgument( - ids_vars.size(), 0, "The number of Ids expected > 0, but got %d", - ids_vars.size())); + PADDLE_ENFORCE_GT( + ids_vars.size(), 0, + platform::errors::InvalidArgument( + ids_vars.size(), 0, "The number of Ids expected > 0, but got %d", + ids_vars.size())); auto *ids_var = ids_vars[0]; if (ids_var->IsType()) {