We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8af39b0 commit 67058baCopy full SHA for 67058ba
test/utils.py
@@ -22,6 +22,10 @@ def needs_cuda(test_item):
22
23
24
def cpu_and_cuda():
25
+ if not torch.cuda.is_available():
26
+ if os.environ.get("FAIL_WITHOUT_CUDA") == "1":
27
+ raise RuntimeError("CUDA is required for this test")
28
+ return ("cpu",)
29
return ("cpu", pytest.param("cuda", marks=pytest.mark.needs_cuda))
30
31
0 commit comments