Paddle index_add反向传播报错

h6my8fg2  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(44)

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

h7appiyu

h7appiyu1#

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

相关问题