diff --git a/paddle/fluid/operators/concat_op.cc b/paddle/fluid/operators/concat_op.cc index 5d5ad9e711a97fb2ab83df40c7605902d5aa7751..71985ea9d4dc140042d61ed1cb221816ca600530 100644 --- a/paddle/fluid/operators/concat_op.cc +++ b/paddle/fluid/operators/concat_op.cc @@ -57,7 +57,7 @@ class ConcatOp : public framework::OperatorWithKernel { "elements except the specify axis."); } else { // not check -1 with other in compile time - if (out_dims[j] != -1 && ins[i][j] != -1) { + if (out_dims[j] != > 0 && ins[i][j] > 0) { PADDLE_ENFORCE_EQ(out_dims[j], ins[i][j], "Input tensors should have the same " "elements except the specify axis.");