Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

skip unsupported tests cases for torch==1.9.1 (#2770)

João Gustavo A. Amorim2c77ec0201e8
diff --git a/tests/contrib/models/test_efficient_vit.py b/tests/contrib/models/test_efficient_vit.py
index 6dc8efbdc..6b392f4ea 100644
--- a/tests/contrib/models/test_efficient_vit.py
+++ b/tests/contrib/models/test_efficient_vit.py
@@ -48,6 +48,7 @@ class TestEfficientViT:
assert model_path.is_file()
+ @pytest.mark.slow
def test_load_pretrained(self, device, dtype):
model = EfficientViT.from_config(EfficientViTConfig())
model = model.to(device=device, dtype=dtype)
diff --git a/tests/feature/test_lightglue_onnx.py b/tests/feature/test_lightglue_onnx.py
index ace6fc609..e341a29f9 100644
--- a/tests/feature/test_lightglue_onnx.py
+++ b/tests/feature/test_lightglue_onnx.py
@@ -3,6 +3,7 @@ import torch
from kornia.feature import OnnxLightGlue
from kornia.feature.lightglue_onnx.utils import normalize_keypoints
+from kornia.utils._compat import torch_version_le
try:
import onnxruntime as ort
@@ -11,6 +12,7 @@ except ImportError:
@pytest.mark.skipif(ort is None, reason="OnnxLightGlue requires onnxruntime-gpu")
[email protected](torch_version_le(1, 9, 1), reason="Needs dlpack")
class TestOnnxLightGlue:
@pytest.mark.slow
@pytest.mark.skipif(not torch.cuda.is_available(), reason="Test requires CUDA")
diff --git a/tests/feature/test_matching.py b/tests/feature/test_matching.py
index 0393b1027..4446b2784 100644
--- a/tests/feature/test_matching.py
+++ b/tests/feature/test_matching.py
@@ -13,6 +13,7 @@ from kornia.feature.matching import (
match_smnn,
match_snn,
)
+from kornia.utils._compat import torch_version_le
from testing.base import BaseTester
from testing.casts import dict_to
@@ -448,6 +449,7 @@ class TestAdalam(BaseTester):
class TestLightGlueDISK(BaseTester):
@pytest.mark.slow
+ @pytest.mark.skipif(torch_version_le(1, 9, 1), reason="Needs autocast")
@pytest.mark.parametrize("data", ["lightglue_idxs"], indirect=True)
def test_real(self, device, dtype, data):
torch.random.manual_seed(0)