Skip to content

Commit

Permalink
limit concat_op
Browse files Browse the repository at this point in the history
  • Loading branch information
sljlp committed Dec 2, 2022
1 parent 2a81756 commit e40c51f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/paddle/tensor/manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,10 @@ def concat(x, axis=0, name=None):
# [14 15 16]]
"""
input = x

if not isinstance(input, Variable) and input[0].shape == []:
raise ValueError("zero-dimensional arrays cannot be concatenated")

if in_dygraph_mode():
if isinstance(axis, Variable):
axis = axis.numpy()
Expand Down

0 comments on commit e40c51f

Please sign in to comment.