Skip to content

fix nonzero #72003

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

Merged
merged 3 commits into from
Apr 3, 2025
Merged

fix nonzero #72003

merged 3 commits into from
Apr 3, 2025

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),)

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