Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concat api support empty tensor. #35845

Merged
merged 1 commit into from
Sep 24, 2021
Merged

concat api support empty tensor. #35845

merged 1 commit into from
Sep 24, 2021

Conversation

wuhuachaocoding
Copy link
Contributor

@wuhuachaocoding wuhuachaocoding commented Sep 17, 2021

PR types

New features

PR changes

APIs

Describe

concat api support empty tensor in dygraph mode.
屏幕快照 2021-09-17 下午8 13 13
屏幕快照 2021-09-17 下午8 16 38

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wangxicoding wangxicoding left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -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]
Copy link
Contributor

Choose a reason for hiding this comment

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

之后加个注释说明这段逻辑是为了支持empty tensor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的

@wangxicoding wangxicoding merged commit eb28a36 into PaddlePaddle:develop Sep 24, 2021
AnnaTrainingG pushed a commit to AnnaTrainingG/Paddle that referenced this pull request Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants