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 bug of inplace fill_ and zero_ API #41229

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

pangyoki
Copy link
Contributor

@pangyoki pangyoki commented Mar 31, 2022

PR types

Bug fixes

PR changes

APIs

Describe

对于fill_zero_ inplace API,输入在CUDAPinned Place上时,输出会被拷贝到CUDA Place上。

  • 原inplace逻辑
    使用ModifyInplaceInput只将输出的meta信息赋值给输入,输入的impl信息还是输入Tensor。
    导致对上述场景,输出为CUDAPinnedPlace上的值。与老动态图行为不一致。
  • 修复后逻辑
    使用GetOutput,将输出的impl信息整个赋给输入。这样输入的TensorBase也变成了输出。
    将会输出CUDAPlace上的值。

@paddle-bot-old
Copy link

paddle-bot-old bot commented Mar 31, 2022

✅ This PR's description meets the template requirements!
Please wait for other CI results.

@paddle-bot-old
Copy link

你的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.

Copy link
Contributor

@veyron95 veyron95 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

@pangyoki pangyoki merged commit f1c5815 into PaddlePaddle:develop Apr 1, 2022
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.

4 participants