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 committed Sep 26, 2021
1 parent e262125 commit 8aeacbe
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

1 comment on commit 8aeacbe

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.