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

[Zero-Dim] Support output 0D for squeeze, unbind, unstack. #52843

Merged
merged 12 commits into from
Apr 28, 2023

Conversation

zhengqiwen1997
Copy link
Contributor

@zhengqiwen1997 zhengqiwen1997 commented Apr 12, 2023

PR types

New features

PR changes

APIs

Description

pcard-66984
支持API输出0D Tensor:squeeze, unbind, unstack.

@paddle-bot
Copy link

paddle-bot bot commented Apr 12, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@zhengqiwen1997 zhengqiwen1997 changed the title [Zero-Dim] Support output 0D for squeeze, unbind, unstack. Zero-Dim :Support output 0D for squeeze, unbind, unstack. Apr 23, 2023
@zhengqiwen1997 zhengqiwen1997 changed the title Zero-Dim :Support output 0D for squeeze, unbind, unstack. [Zero-Dim] Support output 0D for squeeze, unbind, unstack. Apr 23, 2023
x1 = paddle.full([1], 0)
x2 = paddle.full([2], 2)

[out1] = paddle.unstack(x1, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个API有反向,需要测一下反向。x1.grad/x2.grad

x1 = paddle.full([1], 0)
x2 = paddle.full([2], 2)

[out1] = paddle.unbind(x1, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个API有反向,需要测一下反向。x1.grad/x2.grad

@@ -4073,6 +4122,36 @@ def test_upsample(self):
self.assertEqual(res1[0].shape, (2, 3, 12, 12))
self.assertEqual(res1[1].shape, (2, 3, 6, 6))

@prog_scope()
def test_unstack(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

测试case同静态图

Copy link
Contributor

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit 6adfcdf into PaddlePaddle:develop Apr 28, 2023
@paddle-bot
Copy link

paddle-bot bot commented Apr 28, 2023

你的PR已合入Paddle库,请关注后续测试结果。
Your PR has been merged into the repository. An official integration test will be conducted later. Stay tuned.

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