We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug The test for device handling seems to require the wrong output. It should not fail on a cuda capable machine.
To Reproduce pytest tests/torchutils_test.py::test_process_device
pytest tests/torchutils_test.py::test_process_device
Expected behavior the test should pass.
Additional context
...............xxxx......x............................................................................................. [100%] ============================================================ FAILURES ============================================================ ___________________________________________________ test_process_device[cuda] ____________________________________________________
device_input = 'cuda'
@pytest.mark.parametrize("device_input", ("cpu", "gpu", "cuda", "cuda:0", "mps")) def test_process_device(device_input: str) -> None: """Test whether the device is processed correctly.""" try: device_output = torchutils.process_device(device_input) if device_input == "cpu": assert device_output == "cpu" elif device_input == "gpu": if torch.cuda.is_available(): current_gpu_index = torch.cuda.current_device() assert device_output == f"cuda:{current_gpu_index}" 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"
E AssertionError: assert 'cuda' == 'cuda:0' E E - cuda:0 E ? -- E + cuda
../sbi/tests/torchutils_test.py:219: AssertionError
The text was updated successfully, but these errors were encountered:
fix #1047: returning cuda suffices
e1f828d
fix #1047: process_device will return input when device is working.
aba8aea
0b5f931
janfb
No branches or pull requests
Describe the bug
The test for device handling seems to require the wrong output. It should not fail on a cuda capable machine.
To Reproduce
pytest tests/torchutils_test.py::test_process_device
Expected behavior
the test should pass.
Additional context
...............xxxx......x............................................................................................. [100%]
============================================================ FAILURES ============================================================
___________________________________________________ test_process_device[cuda] ____________________________________________________
device_input = 'cuda'
E AssertionError: assert 'cuda' == 'cuda:0'
E
E - cuda:0
E ? --
E + cuda
../sbi/tests/torchutils_test.py:219: AssertionError
The text was updated successfully, but these errors were encountered: