-
Notifications
You must be signed in to change notification settings - Fork 80
[API Compatibility] Add some CUDA device management APIs to NONEED_CONVERT #719
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ def test_case_1(): | |
pytorch_code = textwrap.dedent( | ||
""" | ||
import torch | ||
torch.cuda.set_device(0) | ||
torch.cuda.set_device("cuda:0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 目前不支持直接set一个int吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 支持的,但是目前有个情况是,写0会有如下报错,改成cuda:0不会报错,本地测试0和cuda:0均可以通过,我继续定位问题 |
||
result = torch.cuda.current_device() | ||
""" | ||
) | ||
|
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.
这种也可以直接用APIBase,无需再重写了
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.
好的