Skip to content

Commit

Permalink
fix #1047: process_device will return input when device is working.
Browse files Browse the repository at this point in the history
  • Loading branch information
janfb committed Apr 12, 2024
1 parent 81ce2c9 commit aba8aea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/torchutils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,8 @@ def test_process_device(device_input: str) -> None:
elif torch.backends.mps.is_available():
assert device_output == "mps:0"

if device_input == "cuda" and torch.cuda.is_available():
assert device_output == "cuda:0"
if device_input == "cuda:0" and torch.cuda.is_available():
assert device_output == "cuda:0"
if device_input.startswith("cuda") and torch.cuda.is_available():
assert device_output == device_input
if device_input == "mps" and torch.backends.mps.is_available():
assert device_output == "mps"

Expand Down

0 comments on commit aba8aea

Please sign in to comment.