提交 cb3bf581 编写于 作者: S seiriosPlus

fix error

上级 a4910288
......@@ -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, "
......
......@@ -36,7 +36,9 @@ class SplitIdsOpKernel : public framework::OpKernel<T> {
const auto ids_vars = ctx.MultiInputVar("Ids");
PADDLE_ENFORCE_GT(platform::errors::InvalidArgument(
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];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册