Commit e52ccb3
[Device] Replace hardcoded devices with 'torch._C._get_accelerator()' (pytorch#139032)
I noticed that some hard-code like `"cuda" if torch.cuda.is_available() else "cpu"` which can be replaced with `torch._C._get_accelerator()`
Pull Request resolved: pytorch#139032
Approved by: https://github.com/ezyang1 parent a0865b0 commit e52ccb3
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments