-
Couldn't load subscription status.
- Fork 5.9k
[Device] Add paddle.device.device_guard to public API for eager mode only #73964
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
[Device] Add paddle.device.device_guard to public API for eager mode only #73964
Conversation
| 你的PR提交成功,感谢你对开源项目的贡献! |
device_guard to public APIpaddle.device.device_guard to public API 89704c3 to f117c65 Compare f117c65 to 16a5afb Compare Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## develop #73964 +/- ## ========================================== Coverage ? 94.11% ========================================== Files ? 1 Lines ? 17 Branches ? 0 ========================================== Hits ? 16 Misses ? 1 Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| set_grad_enabled, | ||
| ) | ||
| from .device import ( # noqa: F401 | ||
| device_guard, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是想暴露到 paddle.device_guard?具体公开 API 是哪个?paddle.device.device_guard 还是 paddle.device_guard?
如果确定是公开 API 需要将其加到对应模块的 __all__ 里
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加
| Place(gpu:0) | ||
| >>> # Set the global default device to GPU:0 | ||
| >>> paddle.set_device("gpu:0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
paddle.device.device_guard to public APIpaddle.device.device_guard to public API for eager mode only There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b789a4e into PaddlePaddle:develop
PR Category
User Experience
PR Types
New features
Description
Pcard-75624
参考
paddle.device.stream_guard,添加设备上下文管理器paddle.device.device_guard(...),主要功能与torch.device(...)对齐;同时添加了相关单测Note
paddle.device.device_guard仅适用于动态图