File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,19 @@ class ConcatOp : public framework::OperatorWithKernel {
50
50
if (j == axis) {
51
51
out_dims[axis] += ins[i][j];
52
52
} else {
53
- PADDLE_ENFORCE_EQ (out_dims[j], ins[i][j],
54
- " Input tensors should have the same "
55
- " elements except the specify axis." );
53
+ if (ctx->IsRuntime ()) {
54
+ // check all shape in run time
55
+ PADDLE_ENFORCE_EQ (out_dims[j], ins[i][j],
56
+ " Input tensors should have the same "
57
+ " elements except the specify axis." );
58
+ } else {
59
+ // not check -1 with other in compile time
60
+ if (out_dims[j] > 0 && ins[i][j] > 0 ) {
61
+ PADDLE_ENFORCE_EQ (out_dims[j], ins[i][j],
62
+ " Input tensors should have the same "
63
+ " elements except the specify axis." );
64
+ }
65
+ }
56
66
}
57
67
}
58
68
}
You can’t perform that action at this time.
0 commit comments