Skip to content

Commit e40c51f

Browse files
committed
limit concat_op
1 parent 2a81756 commit e40c51f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/paddle/tensor/manipulation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,10 @@ def concat(x, axis=0, name=None):
11271127
# [14 15 16]]
11281128
"""
11291129
input = x
1130+
1131+
if not isinstance(input, Variable) and input[0].shape == []:
1132+
raise ValueError("zero-dimensional arrays cannot be concatenated")
1133+
11301134
if in_dygraph_mode():
11311135
if isinstance(axis, Variable):
11321136
axis = axis.numpy()

0 commit comments

Comments
 (0)