KEMBAR78
fix nonzero by aquagull · Pull Request #72003 · PaddlePaddle/Paddle · GitHub
Skip to content

Conversation

@aquagull
Copy link
Contributor

@aquagull aquagull commented Mar 31, 2025

PR Category

User Experience

PR Types

Bug fixes

Description

错误复现

x = paddle.zeros(shape=[1], dtype=bool)
pa_non = paddle.nonzero(x, as_tuple=True)
print(pa_non)
x_torch = torch.zeros((1), dtype=torch.bool)
tor_non = torch.nonzero(x_torch, as_tuple=True)
print(tor_non)
(Tensor(shape=[0, 1], dtype=int64, place=Place(gpu:0), stop_gradient=True,
       []),)
(tensor([], dtype=torch.int64),)

@paddle-bot
Copy link

paddle-bot bot commented Mar 31, 2025

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

@paddle-bot paddle-bot bot added the contributor External developers label Mar 31, 2025
Copy link
Contributor

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 4368b7f into PaddlePaddle:develop Apr 3, 2025
32 checks passed
aquagull added a commit to aquagull/Paddle that referenced this pull request Apr 7, 2025
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
* fix

* fix test

* fix
@aquagull aquagull deleted the nonzero branch August 8, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants