Skip to content

Commit bc13ab9

Browse files
concat api support empty tensor. (#35845) (#36096)
1 parent effb70f commit bc13ab9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/paddle/fluid/layers/tensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ def concat(input, axis=0, name=None):
322322
if isinstance(axis, Variable):
323323
axis = axis.numpy()
324324
axis = axis.item(0)
325+
if not isinstance(input, Variable):
326+
input = [t for t in input if t.shape.count(0) == 0]
325327
return _C_ops.concat(input, 'axis', axis)
326328

327329
check_type(input, 'input', (list, tuple, Variable), 'concat')

0 commit comments

Comments
 (0)