Skip to content

Commit

Permalink
concat api support empty tensor. (#35845)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhuachaocoding authored Sep 24, 2021
1 parent 0c0817c commit eb28a36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/paddle/fluid/layers/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def concat(input, axis=0, name=None):
if isinstance(axis, Variable):
axis = axis.numpy()
axis = axis.item(0)
if not isinstance(input, Variable):
input = [t for t in input if t.shape.count(0) == 0]
return _C_ops.concat(input, 'axis', axis)

check_type(input, 'input', (list, tuple, Variable), 'concat')
Expand Down

0 comments on commit eb28a36

Please sign in to comment.