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

fix stack grad gpu #32781

Merged
merged 1 commit into from
May 7, 2021
Merged

Conversation

bjjwwang
Copy link
Contributor

@bjjwwang bjjwwang commented May 7, 2021

PR types

Bug Fixes

PR changes

OPs

Describe

  • 修复stack gpu kernel 空指针错误
    示例程序
import paddle
import numpy as np
paddle.set_device("gpu")
x1 = paddle.to_tensor([[1.0, 2.0]])
x2 = paddle.to_tensor([[3.0, 4.0]])
x3 = paddle.to_tensor([[5.0, 6.0]])
x3.stop_gradient=False
out = paddle.stack([x1, x2, x3], axis=0)
print(paddle.grad(out, [x3]))

预期输出

[Tensor(shape=[1, 2], dtype=float32, place=CUDAPlace(0), stop_gradient=True,
       [[1., 1.]])]

修改前 GPU版本出现 非法内存访问错误

@paddle-bot-old
Copy link

paddle-bot-old bot commented May 7, 2021

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGMT

@XiaoguangHu01 XiaoguangHu01 merged commit f54fb1e into PaddlePaddle:release/2.1 May 7, 2021
bjjwwang added a commit to bjjwwang/Paddle that referenced this pull request May 12, 2021
gentelyang pushed a commit that referenced this pull request May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants