From cb3bf58114e001b15cbc51a1e700eecb8b425aef Mon Sep 17 00:00:00 2001 From: seiriosPlus Date: Sun, 27 Sep 2020 15:07:12 +0800 Subject: [PATCH] fix error --- paddle/fluid/operators/distributed_ops/split_ids_op.cc | 2 +- paddle/fluid/operators/distributed_ops/split_ids_op.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/distributed_ops/split_ids_op.cc b/paddle/fluid/operators/distributed_ops/split_ids_op.cc index e1154343d6a..0fe8f58595f 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 0861346bfc2..8a3ebe6e258 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()) { -- GitLab