Skip to content

Commit 7e6f462

Browse files
[Fix] Skip CPU test in test_rotated_feature_align.py for parrots (#1968)
* skip test_rotated_feature_align.py for parrots Signed-off-by: del-zhenwu <[email protected]> * fix lint Co-authored-by: zhouzaida <[email protected]>
1 parent 60eadb0 commit 7e6f462

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/test_ops/test_rotated_feature_align.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
import torch
44

55
from mmcv.ops import rotated_feature_align
6+
from mmcv.utils import IS_CUDA_AVAILABLE
67

78

89
@pytest.mark.skipif(
910
not torch.cuda.is_available(), reason='requires CUDA support')
10-
@pytest.mark.parametrize('device', ['cuda', 'cpu'])
11+
@pytest.mark.parametrize('device', [
12+
pytest.param(
13+
'cuda',
14+
marks=pytest.mark.skipif(
15+
not IS_CUDA_AVAILABLE, reason='requires CUDA support')),
16+
pytest.param(
17+
'cpu',
18+
marks=pytest.mark.skipif(
19+
torch.__version__ == 'parrots', reason='requires PyTorch support'))
20+
])
1121
def test_rotated_feature_align(device):
1222
feature = torch.tensor([[[[1.2924, -0.2172, -0.5222, 0.1172],
1323
[0.9144, 1.2248, 1.3115, -0.9690],

0 commit comments

Comments
 (0)