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 get_int_tensor_list #63593

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Fix get_int_tensor_list #63593

merged 1 commit into from
Apr 17, 2024

Conversation

0x45f
Copy link
Contributor

@0x45f 0x45f commented Apr 17, 2024

PR Category

Performance Optimization

PR Types

Performance

Description

Pcard-67164
原来get_int_tensor_list函数存在的问题:

  • get_int_tensor_list 内调用的full函数并不接受一个place参数,place对应的是name参数的位置,place并没有被真正用到
  • 原来get_int_tensor_list虽然可以执行但是shape作为可变attr时调用的full会产生GPU的tensor,但是作为可变attr在调用kernel又需要拷贝回CPU。

所以在本PR中用fill_constant替换了full,并指定了force_cpu=True,避免多余的拷贝操作

Copy link

paddle-bot bot commented Apr 17, 2024

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

@0x45f 0x45f merged commit 2bbc40f into PaddlePaddle:develop Apr 17, 2024
29 checks passed
@0x45f 0x45f deleted the fix-tensor-shape branch April 17, 2024 07:33
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.

3 participants