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

sum算子bug #51882

Closed
Difers opened this issue Mar 20, 2023 · 5 comments
Closed

sum算子bug #51882

Difers opened this issue Mar 20, 2023 · 5 comments
Labels
good first issue PFCC Paddle Framework Contributor Club,/~https://github.com/PaddlePaddle/community/tree/master/pfcc status/following-up 跟进中 type/bug-report 报bug

Comments

@Difers
Copy link
Contributor

Difers commented Mar 20, 2023

在调试Beta算子时发现了sum算子的一个bug,
gpu环境下出错,cpu正常:测试代码如下

import paddle
import numpy as np
paddle.set_device("gpu")
array = np.array([], dtype=np.float32)
x = paddle.to_tensor(np.reshape(array, [0, 2]), dtype='float32')
x.sum(-1)

image
应该是reduce_ function.h下Run函数某一步出错,但下面的维度变化我没看懂QAQ

Originally posted by @Difers in #49922 (comment)

@wuyefeilin
Copy link
Contributor

x为零维tensor, sum算子目前不支持该类型计算。

@Difers
Copy link
Contributor Author

Difers commented Mar 21, 2023

x为零维tensor, sum算子目前不支持该类型计算。

cpu环境下是支持的,想要修复的话是处理至和CPU环境下一致的结果,还是直接在两端都加上维度检查呢?

@wuyefeilin
Copy link
Contributor

我看在cpu下面x.sum()结果时错的,x.sum(-1)符合逻辑结构。要修复的话还是得在cpu和gpu下都进行修复,使其符合逻辑

@luotao1
Copy link
Contributor

luotao1 commented Mar 22, 2023

@Difers 可以尝试修复一下~

@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,/~https://github.com/PaddlePaddle/community/tree/master/pfcc label Mar 22, 2023
@paddle-bot paddle-bot bot closed this as completed Mar 26, 2024
Copy link

paddle-bot bot commented Mar 26, 2024

Since you haven't replied for more than a year, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过一年未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue PFCC Paddle Framework Contributor Club,/~https://github.com/PaddlePaddle/community/tree/master/pfcc status/following-up 跟进中 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

3 participants