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

index_add反向传播报错 #63937

Open
DrownFish19 opened this issue Apr 28, 2024 · 1 comment
Open

index_add反向传播报错 #63937

DrownFish19 opened this issue Apr 28, 2024 · 1 comment
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/new-issue 新建 type/bug-report 报bug

Comments

@DrownFish19
Copy link
Contributor

bug描述 Describe the Bug

bug描述 Describe the Bug

复现代码

import paddle
input_tensor = paddle.to_tensor(paddle.ones((3, 3)), dtype="float32")
index = paddle.to_tensor([0, 2], dtype="int32")
value = paddle.to_tensor([[1, 1, 1], [1, 1, 1]], dtype="float32", stop_gradient=False)
# 报错
# ValueError: (InvalidArgument) Required tensor shall not be nullptr, but received nullptr.
#  [Hint: tensor should not be null.] (at /paddle/paddle/phi/core/device_context.cc:144)
outplace_res = paddle.index_add(input_tensor, index, 0, value)
outplace_res.backward()
# 正常运行
outplace_res = paddle.index_add_(input_tensor, index, 0, value)
outplace_res.backward()

其他补充信息 Additional Supplementary Information

No response

@DrownFish19 DrownFish19 changed the title index_add和index_add_计算后反向不一致 index_add反向传播报错 Apr 28, 2024
@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Apr 28, 2024
@Galaxy1458
Copy link
Contributor

感谢,bug已收到,会在后续联系该算子负责人加紧修复

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

No branches or pull requests

2 participants