Skip to content

Commit 8af39b0

Browse files
committed
.
1 parent c18b1c1 commit 8af39b0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
import torch
1313

1414

15-
def cpu_and_cuda():
16-
import pytest # noqa
17-
18-
return ("cpu", pytest.param("cuda", marks=pytest.mark.needs_cuda))
19-
20-
2115
# Decorator for skipping CUDA tests when CUDA isn't available
2216
def needs_cuda(test_item):
2317
if not torch.cuda.is_available():
@@ -27,6 +21,10 @@ def needs_cuda(test_item):
2721
return test_item
2822

2923

24+
def cpu_and_cuda():
25+
return ("cpu", pytest.param("cuda", marks=pytest.mark.needs_cuda))
26+
27+
3028
def get_tensor_compare_function(device):
3129
if device == "cpu":
3230
return assert_tensor_equal

0 commit comments

Comments
 (0)