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

【Hackathon 6th No.9】Update stack op to support zero sized tensor -part #64977

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

NKNaN
Copy link
Contributor

@NKNaN NKNaN commented Jun 6, 2024

PR Category

User Experience

PR Types

Improvements

Description

Support zero sized tensor stack operation:

x1 = paddle.ones([0, 1, 2])
x2 = paddle.ones([0, 1, 2])
out = paddle.stack([x1, x2])
# out -> shape = [2, 0, 1, 2]

x1 = paddle.ones([0, 1, 2])
x2 = paddle.ones([0, 1, 2])
out = paddle.stack([x1, x2], axis=1)
# out -> shape = [0, 2, 1, 2]

The gradient for each zero sized tensor in the input list of stack is None

Copy link

paddle-bot bot commented Jun 6, 2024

你的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.

luotao1
luotao1 previously approved these changes Jun 12, 2024
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

  1. 这里覆盖率没过的原因是什么?本地能覆盖到么?
  2. 可以在下一个PR中,stack的注释里填加下 support zero sized tensor 的说明,放上 Description里的示例代码,同中文。

@NKNaN
Copy link
Contributor Author

NKNaN commented Jun 14, 2024

  1. 这里覆盖率没过的原因是什么?本地能覆盖到么?

在kernel里cout来看的话确实应该 stack_kernel.cc 和 stack_grad_kernel.cc 都跑到了
stack
stack_grad
ctest

  1. 可以在下一个PR中,stack的注释里填加下 support zero sized tensor 的说明,放上 Description里的示例代码,同中文。

好的

Copy link

paddle-ci-bot bot commented Jun 15, 2024

Sorry to inform you that f4cc809's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1
Copy link
Contributor

luotao1 commented Jun 24, 2024

请重新触发下 CI

@luotao1 luotao1 merged commit f56c21f into PaddlePaddle:develop Jun 27, 2024
33 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants