Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

chore(tests): remove unused grad/jit/nn pytest markers (#3992)

Advait Shukla570a96e37321
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5066faadb..883e0df24 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -116,7 +116,7 @@ The rest of this guide contains practical and technical guidance so nobody has t
pixi run test-f32 # Run tests with float32
pixi run test-f64 # Run tests with float64
pixi run test-slow # Run slow tests
- pixi run test-quick # Run quick tests (excludes jit, grad, nn)
+ pixi run test-quick # Run quick tests (same as `pixi run test`)
pixi run test-module tests/<path> # Run a focused test path
pixi run test-half # Run CPU float16/bfloat16 tests
diff --git a/TESTING.md b/TESTING.md
index 3d2cd8179..f31d10cc1 100644
--- a/TESTING.md
+++ b/TESTING.md
@@ -22,7 +22,7 @@ pixi run test --device=all --dtype=all
# Skip slow tests (default); include them with --runslow
pixi run test --runslow
-# Quick tests (excludes jit, grad, nn markers)
+# Quick tests (same as `pixi run test`; slow tests are skipped by default)
pixi run test-quick
```
@@ -61,9 +61,6 @@ The `device` and `dtype` fixtures are injected automatically from the CLI option
| Marker | Meaning |
|---|---|
| `@pytest.mark.slow` | Long-running test; skipped unless `--runslow` is passed |
-| `@pytest.mark.grad` | Gradient-check test |
-| `@pytest.mark.jit` | TorchScript test |
-| `@pytest.mark.nn` | Module-level test |
| `@pytest.mark.tf32` | Known to fail under TF32 (see section below); xfail unless `--tf32` |
---
diff --git a/pixi.toml b/pixi.toml
index 4e6e4e51a..c818216e0 100644
--- a/pixi.toml
+++ b/pixi.toml
@@ -42,7 +42,7 @@ test = { cmd = "uv run pytest -v tests/", description = "Run tests (configure vi
test-f32 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float32" } }
test-f64 = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float64" } }
test-slow = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_RUNSLOW = "true" } }
-test-quick = { cmd = "uv run pytest -v -m 'not (jit or grad or nn)' tests/" }
+test-quick = { cmd = "uv run pytest -v tests/" }
test-half = { cmd = "uv run pytest -v tests/", env = { KORNIA_TEST_DTYPE = "float16,bfloat16" }, description = "Run CPU half-precision tests" }
test-module = { cmd = "uv run pytest -v", description = "Run tests for a specific module (usage: pixi run test-module tests/<module_path>, e.g., pixi run test-module tests/contrib/)" }
# Quality
diff --git a/pyproject.toml b/pyproject.toml
index 5a19d5cee..fcd856f68 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -182,9 +182,6 @@ filterwarnings = [
"ignore::DeprecationWarning:onnxscript.converter",
]
markers = [
- "grad: mark a test as gradcheck test",
- "jit: mark a test as torchscript test",
- "nn: mark a test as module test",
"slow: mark test as slow to run",
"tf32: mark a test as sensitive to TF32 (TensorFloat-32) CUDA matmul precision; xfail by default, run with --tf32 to activate",
]
diff --git a/tests/augmentation/container/test_augmentation_sequential.py b/tests/augmentation/container/test_augmentation_sequential.py
index fec1f6402..748eff744 100644
--- a/tests/augmentation/container/test_augmentation_sequential.py
+++ b/tests/augmentation/container/test_augmentation_sequential.py
@@ -513,7 +513,6 @@ class TestAugmentationSequential:
if random_apply is False:
reproducibility_test((inp, mask, bbox, keypoints, bbox_2, bbox_wh, bbox_wh_2), aug)
- @pytest.mark.jit()
@pytest.mark.skip(reason="turn off due to Union Type")
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
diff --git a/tests/augmentation/container/test_video_sequential.py b/tests/augmentation/container/test_video_sequential.py
index a8736b23b..276da0dc8 100644
--- a/tests/augmentation/container/test_video_sequential.py
+++ b/tests/augmentation/container/test_video_sequential.py
@@ -141,7 +141,6 @@ class TestVideoSequential:
output_2 = output_2.transpose(1, 2)
assert_close(output_1, output_2)
- @pytest.mark.jit()
@pytest.mark.skip(reason="turn off due to Union Type")
def test_jit(self, device, dtype):
B, C, D, H, W = 2, 3, 5, 4, 4
diff --git a/tests/color/test_gray.py b/tests/color/test_gray.py
index c72c8d760..a70b3cad8 100644
--- a/tests/color/test_gray.py
+++ b/tests/color/test_gray.py
@@ -101,7 +101,6 @@ class TestGrayscaleToRgb(BaseTester):
img_rgb = kornia.color.grayscale_to_rgb(data)
assert_close(img_rgb, expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 1, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
@@ -223,7 +222,6 @@ class TestRgbToGrayscale(BaseTester):
assert img_gray.device == device
assert img_gray.dtype == dtype
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
@@ -319,7 +317,6 @@ class TestBgrToGrayscale(BaseTester):
img_gray = kornia.color.bgr_to_grayscale(data)
assert_close(img_gray, expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
diff --git a/tests/color/test_hls.py b/tests/color/test_hls.py
index 25f6c1b13..c94bf757a 100644
--- a/tests/color/test_hls.py
+++ b/tests/color/test_hls.py
@@ -130,13 +130,11 @@ class TestRgbToHls(BaseTester):
ext_rand_slice = (torch.rand((1, 3, 32, 32), dtype=dtype, device=device) >= 0.5).float()
assert not kornia.color.rgb_to_hls(ext_rand_slice).isnan().any()
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_hls, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -248,13 +246,11 @@ class TestHlsToRgb(BaseTester):
data[:, 0] -= 4 * math.pi
self.assert_close(f(data), expected, low_tolerance=True)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.hls_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_hsv.py b/tests/color/test_hsv.py
index 4e928d940..c341f5226 100644
--- a/tests/color/test_hsv.py
+++ b/tests/color/test_hsv.py
@@ -326,13 +326,11 @@ class TestHsvToRgb(BaseTester):
expected_black = torch.zeros(5, 3, 1, 1, device=device, dtype=dtype)
self.assert_close(kornia.color.hsv_to_rgb(data_black), expected_black)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.hsv_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_lab.py b/tests/color/test_lab.py
index 318beb884..9e93d1039 100644
--- a/tests/color/test_lab.py
+++ b/tests/color/test_lab.py
@@ -115,13 +115,11 @@ class TestRgbToLab(BaseTester):
data_out = lab(rgb(data, clip=False))
self.assert_close(data_out, data)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_lab, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -260,14 +258,12 @@ class TestLabToRgb(BaseTester):
unclipped_data_out = rgb(lab(data), clip=False)
self.assert_close(unclipped_data_out, data)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
img = kornia.color.rgb_to_lab(img)
assert gradcheck(kornia.color.lab_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_luv.py b/tests/color/test_luv.py
index 3d5088e39..c8107845d 100644
--- a/tests/color/test_luv.py
+++ b/tests/color/test_luv.py
@@ -117,13 +117,11 @@ class TestRgbToLuv(BaseTester):
data_out = luv(rgb(data))
self.assert_close(data_out, data)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_luv, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -236,14 +234,12 @@ class TestLuvToRgb(BaseTester):
data_out = rgb(luv(data))
self.assert_close(data_out, data)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
img = kornia.color.rgb_to_luv(img)
assert gradcheck(kornia.color.luv_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_raw.py b/tests/color/test_raw.py
index b144006ad..311afb78b 100644
--- a/tests/color/test_raw.py
+++ b/tests/color/test_raw.py
@@ -136,13 +136,11 @@ class TestRawToRgb(BaseTester):
assert_close(bgres[:, :, 1:5, 1:5], grres[:, :, 2:6, 1:5])
assert_close(bgres[:, :, 1:5, 1:5], rgres[:, :, 2:6, 2:6])
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 1, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.raw_to_rgb, (img, kornia.color.raw.CFA.BG), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -179,13 +177,11 @@ class TestRgbToRaw(BaseTester):
# Reverse test in rawtorgb is sufficient functional test
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_raw, (img, kornia.color.raw.CFA.BG), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_rgb.py b/tests/color/test_rgb.py
index 93d70ad11..1c3c582ae 100644
--- a/tests/color/test_rgb.py
+++ b/tests/color/test_rgb.py
@@ -88,13 +88,11 @@ class TestRgbToBgr(BaseTester):
f = kornia.color.rgb_to_bgr
self.assert_close(f(data), expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_bgr, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -236,13 +234,11 @@ class TestRgbToRgba(BaseTester):
aval = torch.full_like(data[:, :1], aval) # Bx1xHxW
self.assert_close(kornia.color.rgb_to_rgba(data, aval), expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_rgba, (img, 1.0), raise_exception=True, fast_mode=True)
- @pytest.mark.grad()
def test_gradcheck_th(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
@@ -250,7 +246,6 @@ class TestRgbToRgba(BaseTester):
assert gradcheck(kornia.color.rgb_to_rgba, (img, aval), raise_exception=True, fast_mode=True)
@pytest.mark.skip(reason="unsupported Union type")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -395,14 +390,12 @@ class TestLinearRgb(BaseTester):
f = kornia.color.linear_rgb_to_rgb
self.assert_close(f(data), expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_linear_rgb, (img,), raise_exception=True, fast_mode=True)
assert gradcheck(kornia.color.linear_rgb_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -410,7 +403,6 @@ class TestLinearRgb(BaseTester):
op_jit = torch.jit.script(op)
self.assert_close(op(img), op_jit(img))
- @pytest.mark.jit()
def test_jit_linear(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -464,7 +456,6 @@ class TestRgb255Normals(BaseTester):
normals_restored = kornia.color.rgb255_to_normals(rgb255_normals)
torch.testing.assert_close(data_normals, normals_restored, atol=1e-4, rtol=1e-4)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.full((B, C, H, W), 0.5, device=device, dtype=torch.float64, requires_grad=True)
@@ -473,7 +464,6 @@ class TestRgb255Normals(BaseTester):
assert gradcheck(kornia.color.normals_to_rgb255, (img,), raise_exception=True, fast_mode=True)
assert gradcheck(kornia.color.rgb255_to_normals, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_xyz.py b/tests/color/test_xyz.py
index ea4703588..b18c68c09 100644
--- a/tests/color/test_xyz.py
+++ b/tests/color/test_xyz.py
@@ -115,13 +115,11 @@ class TestRgbToXyz(BaseTester):
data_out = xyz(rgb(data))
self.assert_close(data_out, data)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_xyz, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -228,13 +226,11 @@ class TestXyzToRgb(BaseTester):
data_out = rgb(xyz(data))
self.assert_close(data_out, data, low_tolerance=True)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.xyz_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_ycbcr.py b/tests/color/test_ycbcr.py
index af4bd0aff..aa64ae6f3 100644
--- a/tests/color/test_ycbcr.py
+++ b/tests/color/test_ycbcr.py
@@ -122,13 +122,11 @@ class TestRgbToYcbcr(BaseTester):
# def test_forth_and_back(self, device, dtype):
# pass
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_ycbcr, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -235,13 +233,11 @@ class TestYcbcrToRgb(BaseTester):
# def test_forth_and_back(self, device, dtype):
# pass
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.rand(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.ycbcr_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/color/test_yuv.py b/tests/color/test_yuv.py
index f7997b955..fdc5f3c41 100644
--- a/tests/color/test_yuv.py
+++ b/tests/color/test_yuv.py
@@ -281,12 +281,10 @@ class TestRgbToYuv(BaseTester):
rtol=rtol,
)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img = torch.rand(2, 3, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_yuv, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
img = torch.ones(2, 3, 4, 4, device=device, dtype=dtype)
op = kornia.color.rgb_to_yuv
@@ -392,12 +390,10 @@ class TestRgbToYuv420(BaseTester):
y, uv = kornia.color.rgb_to_yuv420(data)
self.assert_close(kornia.color.yuv420_to_rgb(y, uv), data, atol=atol, rtol=rtol)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img = torch.rand(2, 3, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_yuv420, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
img = torch.ones(2, 3, 4, 4, device=device, dtype=dtype)
op = kornia.color.rgb_to_yuv420
@@ -499,12 +495,10 @@ class TestRgbToYuv422(BaseTester):
y, uv = kornia.color.rgb_to_yuv422(data)
self.assert_close(kornia.color.yuv422_to_rgb(y, uv), data, atol=atol, rtol=rtol)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img = torch.rand(2, 3, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_yuv422, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
img = torch.ones(2, 3, 4, 4, device=device, dtype=dtype)
op = kornia.color.rgb_to_yuv422
@@ -617,12 +611,10 @@ class TestYuvToRgb(BaseTester):
self.assert_close(kornia.color.rgb_to_yuv(kornia.color.yuv_to_rgb(yuv)), yuv, atol=atol, rtol=rtol)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img = torch.rand(2, 3, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.yuv_to_rgb, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
img = torch.ones(2, 3, 4, 4, device=device, dtype=dtype)
op = kornia.color.yuv_to_rgb
@@ -762,13 +754,11 @@ class TestYuv420ToRgb(BaseTester):
self.assert_close(out_y, datay, atol=atol, rtol=rtol)
self.assert_close(out_uv, datauv, atol=atol, rtol=rtol)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
imgy = torch.rand(2, 1, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
imguv = torch.rand(2, 2, 2, 2, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.yuv420_to_rgb, (imgy, imguv), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
imgy = torch.ones(2, 1, 4, 4, device=device, dtype=dtype)
imguv = torch.ones(2, 2, 2, 2, device=device, dtype=dtype)
@@ -901,13 +891,11 @@ class TestYuv422ToRgb(BaseTester):
self.assert_close(out_y, datay, atol=atol, rtol=rtol)
self.assert_close(out_uv, datauv, atol=atol, rtol=rtol)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
imgy = torch.rand(2, 1, 4, 4, device=device, dtype=torch.float64, requires_grad=True)
imguv = torch.rand(2, 2, 4, 2, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.yuv422_to_rgb, (imgy, imguv), raise_exception=True, fast_mode=True)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
imgy = torch.ones(2, 1, 4, 4, device=device, dtype=dtype)
imguv = torch.ones(2, 2, 4, 2, device=device, dtype=dtype)
diff --git a/tests/enhance/test_adjust.py b/tests/enhance/test_adjust.py
index b14cae9cf..5a814a8ab 100644
--- a/tests/enhance/test_adjust.py
+++ b/tests/enhance/test_adjust.py
@@ -46,14 +46,12 @@ class TestInvert(BaseTester):
out = kornia.enhance.invert(img, torch.tensor(255.0))
self.assert_close(out, torch.zeros_like(out))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
B, C, H, W = 1, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
max_val = torch.tensor(1.0, device=device, dtype=torch.float64, requires_grad=True)
self.gradcheck(kornia.enhance.invert, (img, max_val))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 3, 4, 4
img = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -732,7 +730,6 @@ class TestAdjustSigmoid(BaseTester):
op_optimized = torch_optimizer(op)
self.assert_close(op(img), op_optimized(img))
- @pytest.mark.grad()
def test_gradcheck(self, device):
bs, channels, height, width = 1, 2, 3, 3
inputs = torch.ones(bs, channels, height, width, device=device, dtype=torch.float64)
@@ -785,7 +782,6 @@ class TestAdjustLog(BaseTester):
op_optimized = torch_optimizer(op)
self.assert_close(op(img), op_optimized(img))
- @pytest.mark.grad()
def test_gradcheck(self, device):
bs, channels, height, width = 1, 2, 3, 3
inputs = torch.ones(bs, channels, height, width, device=device, dtype=torch.float64)
@@ -1067,14 +1063,12 @@ class TestSharpness(BaseTester):
self.assert_close(TestSharpness.f(inputs, 0.8), expected_08, low_tolerance=True)
self.assert_close(TestSharpness.f(inputs, torch.tensor([0.8, 1.3])), expected_08_13, low_tolerance=True)
- @pytest.mark.grad()
def test_gradcheck(self, device):
bs, channels, height, width = 2, 3, 4, 5
inputs = torch.rand(bs, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(TestSharpness.f, (inputs, 0.8))
@pytest.mark.skip(reason="union type input")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = TestSharpness.f
op_script = torch.jit.script(TestSharpness.f)
@@ -1157,7 +1151,6 @@ class TestSolarize(BaseTester):
# TODO(jian): precision is very bad compared to PIL
self.assert_close(TestSolarize.f(inputs, 0.5), expected, rtol=1e-2, atol=1e-2)
- @pytest.mark.grad()
def test_gradcheck(self, device):
bs, channels, height, width = 2, 3, 4, 5
inputs = torch.rand(bs, channels, height, width, device=device, dtype=torch.float64)
@@ -1165,7 +1158,6 @@ class TestSolarize(BaseTester):
# TODO: implement me
@pytest.mark.skip(reason="union type input")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = TestSolarize.f
op_script = torch.jit.script(op)
@@ -1255,7 +1247,6 @@ class TestPosterize(BaseTester):
self.assert_close(TestPosterize.f(inputs, 8), inputs)
@pytest.mark.skip(reason="IndexError: tuple index out of range")
- @pytest.mark.grad()
def test_gradcheck(self, device):
bs, channels, height, width = 2, 3, 4, 5
inputs = torch.rand(bs, channels, height, width, device=device, dtype=torch.float64)
@@ -1263,7 +1254,6 @@ class TestPosterize(BaseTester):
# TODO: implement me
@pytest.mark.skip(reason="union type input")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = TestPosterize.f
op_script = torch.jit.script(op)
diff --git a/tests/enhance/test_normalize.py b/tests/enhance/test_normalize.py
index 5bb174e01..fa70ba496 100644
--- a/tests/enhance/test_normalize.py
+++ b/tests/enhance/test_normalize.py
@@ -324,7 +324,6 @@ class TestNormalizeMinMax(BaseTester):
op_jit = torch.jit.script(op)
self.assert_close(op(x), op_jit(x))
- @pytest.mark.grad()
def test_gradcheck(self, device):
x = torch.ones(1, 1, 1, 1, device=device, dtype=torch.float64, requires_grad=True)
self.gradcheck(kornia.enhance.normalize_min_max, (x,))
diff --git a/tests/feature/test_defmo.py b/tests/feature/test_defmo.py
index a9da67b96..30ea672fa 100644
--- a/tests/feature/test_defmo.py
+++ b/tests/feature/test_defmo.py
@@ -41,14 +41,12 @@ class TestDeFMO(BaseTester):
assert out.shape == (2, 24, 4, 128, 160)
@pytest.mark.slow
- @pytest.mark.grad
def test_gradcheck(self, device):
patches = torch.rand(2, 6, 64, 64, device=device, dtype=torch.float64)
defmo = DeFMO().to(patches.device, patches.dtype)
self.gradcheck(defmo, (patches,), eps=1e-4, atol=1e-4, nondet_tol=1e-8)
@pytest.mark.slow
- @pytest.mark.jit
def test_jit(self, device, dtype):
B, C, H, W = 1, 6, 128, 160
patches = torch.rand(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/feature/test_hardnet.py b/tests/feature/test_hardnet.py
index 50897085b..1b12302b3 100644
--- a/tests/feature/test_hardnet.py
+++ b/tests/feature/test_hardnet.py
@@ -44,7 +44,6 @@ class TestHardNet(BaseTester):
hardnet = HardNet().to(patches.device, patches.dtype)
self.gradcheck(hardnet, (patches,), eps=1e-4, atol=1e-4, nondet_tol=1e-8)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.ones(B, C, H, W, device=device, dtype=dtype)
@@ -73,7 +72,6 @@ class TestHardNet8(BaseTester):
hardnet = HardNet8().to(patches.device, patches.dtype)
self.gradcheck(hardnet, (patches,), eps=1e-4, atol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/feature/test_hynet.py b/tests/feature/test_hynet.py
index 505b9644f..83aaaa884 100644
--- a/tests/feature/test_hynet.py
+++ b/tests/feature/test_hynet.py
@@ -15,7 +15,6 @@
# limitations under the License.
#
-import pytest
import torch
from kornia.feature import FilterResponseNorm2d, HyNet
@@ -47,7 +46,6 @@ class TestHyNet(BaseTester):
hynet = HyNet().to(patches.device, patches.dtype)
self.gradcheck(hynet, (patches,), eps=1e-4, atol=1e-4, nondet_tol=1e-8)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.rand(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/feature/test_laf.py b/tests/feature/test_laf.py
index 74549dc87..afe2e00fc 100644
--- a/tests/feature/test_laf.py
+++ b/tests/feature/test_laf.py
@@ -44,7 +44,6 @@ class TestAngleToRotationMatrix(BaseTester):
img = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.geometry.transform.imgwarp.angle_to_rotation_matrix, (img,))
- @pytest.mark.jit()
@pytest.mark.skip("Problems with kornia.pi")
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
@@ -72,7 +71,6 @@ class TestGetLAFScale(BaseTester):
img = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.get_laf_scale, (img,))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
img = torch.rand(batch_size, channels, height, width, device=device)
@@ -99,7 +97,6 @@ class TestGetLAFCenter(BaseTester):
img = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.get_laf_center, (img,))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
img = torch.rand(batch_size, channels, height, width, device=device)
@@ -126,7 +123,6 @@ class TestGetLAFOri(BaseTester):
img = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.get_laf_orientation, (img,))
- @pytest.mark.jit()
@pytest.mark.skip("Union")
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -161,7 +157,6 @@ class TestScaleLAF(BaseTester):
scale = torch.rand(batch_size, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.scale_laf, (laf, scale), atol=1e-4)
- @pytest.mark.jit()
@pytest.mark.skip("Union")
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -192,7 +187,6 @@ class TestSetLAFOri(BaseTester):
ori = torch.rand(batch_size, channels, 1, 1, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.set_laf_orientation, (laf, ori), atol=1e-4)
- @pytest.mark.jit()
@pytest.mark.skip("Union")
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -234,7 +228,6 @@ class TestMakeUpright(BaseTester):
img = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.make_upright, (img,))
- @pytest.mark.jit()
@pytest.mark.skip("Union")
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -440,7 +433,6 @@ class TestNormalizeLAF(BaseTester):
img = torch.rand(batch_size, 3, 10, 32, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.normalize_laf, (laf, img))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -470,7 +462,6 @@ class TestLAF2pts(BaseTester):
laf = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.laf_to_boundary_points, (laf))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 3, 2, 2, 3
laf = torch.rand(batch_size, channels, height, width, device=device)
@@ -501,7 +492,6 @@ class TestDenormalizeLAF(BaseTester):
img = torch.rand(batch_size, 3, 10, 32, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.denormalize_laf, (laf, img))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 1, 2, 2, 3
@@ -773,7 +763,6 @@ class TestLAFIsTouchingBoundary(BaseTester):
kornia.feature.laf_is_inside_image(self._radius_laf(26.5, 16.0, r, device, dtype), img, 3)[0, 0]
)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
w, h = 10, 5
img = torch.rand(1, 3, h, w, device=device)
@@ -826,7 +815,6 @@ class TestGetCreateLAF(BaseTester):
self.gradcheck(kornia.feature.laf_from_center_scale_ori, (xy, scale, ori))
@pytest.mark.skip("Depends on angle-to-rotation-matric")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels = 3, 2
xy = torch.rand(batch_size, channels, 2, device=device)
@@ -859,7 +847,6 @@ class TestGetLAF3pts(BaseTester):
inp = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.laf_to_three_points, (inp,))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 3, 2, 2, 3
inp = torch.rand(batch_size, channels, height, width, device=device)
@@ -897,7 +884,6 @@ class TestGetLAFFrom3pts(BaseTester):
inp = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(kornia.feature.laf_from_three_points, (inp,))
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, height, width = 3, 2, 2, 3
inp = torch.rand(batch_size, channels, height, width, device=device)
diff --git a/tests/feature/test_local_features_orientation.py b/tests/feature/test_local_features_orientation.py
index 3d1921cb4..f5d83b82e 100644
--- a/tests/feature/test_local_features_orientation.py
+++ b/tests/feature/test_local_features_orientation.py
@@ -88,7 +88,6 @@ class TestPatchDominantGradientOrientation(BaseTester):
patches = torch.rand(batch_size, channels, height, width, device=device, dtype=torch.float64)
self.gradcheck(ori, (patches,))
- @pytest.mark.jit()
@pytest.mark.skip(" Compiled functions can't take variable number")
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 13, 13
@@ -222,7 +221,6 @@ class TestOriNet(BaseTester):
ori = OriNet().to(device=device, dtype=patches.dtype)
self.gradcheck(ori, (patches,), fast_mode=False)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/feature/test_matching.py b/tests/feature/test_matching.py
index aa106dd05..95729912d 100644
--- a/tests/feature/test_matching.py
+++ b/tests/feature/test_matching.py
@@ -235,7 +235,6 @@ class TestMatchSMNN(BaseTester):
self.gradcheck(match_smnn, (desc1, desc2, 0.8), nondet_tol=1e-4)
self.gradcheck(matcher, (desc1, desc2), nondet_tol=1e-4)
- @pytest.mark.jit()
@pytest.mark.parametrize("match_type", ["nn", "snn", "mnn", "smnn"])
def test_jit(self, match_type, device, dtype):
desc1 = torch.rand(5, 8, device=device, dtype=dtype)
@@ -400,7 +399,6 @@ class TestMatchFGINN(BaseTester):
lafs2 = laf_from_center_scale_ori(center2)
self.gradcheck(match_fginn, (desc1, desc2, lafs1, lafs2, 0.8, 0.05), nondet_tol=1e-4)
- @pytest.mark.jit()
@pytest.mark.skip("keyword-arg expansion is not supported")
def test_jit(self, device, dtype):
desc1 = torch.rand(5, 8, device=device, dtype=dtype)
diff --git a/tests/feature/test_mkd.py b/tests/feature/test_mkd.py
index 31c5e1e31..589810fa5 100644
--- a/tests/feature/test_mkd.py
+++ b/tests/feature/test_mkd.py
@@ -199,7 +199,6 @@ class TestVonMisesKernel(BaseTester):
self.gradcheck(vm_describe, (patches, ps), nondet_tol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 13, 13
patches = torch.rand(B, C, H, W, device=device, dtype=dtype)
@@ -251,7 +250,6 @@ class TestEmbedGradients(BaseTester):
self.gradcheck(emb_grads_describe, (patches, ps), nondet_tol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 2, 13, 13
patches = torch.rand(B, C, H, W, device=device, dtype=dtype)
@@ -322,7 +320,6 @@ class TestExplicitSpacialEncoding(BaseTester):
self.gradcheck(explicit_spatial_describe, (patches, ps), nondet_tol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 2, 13, 13
patches = torch.rand(B, C, H, W, device=device, dtype=dtype)
@@ -383,7 +380,6 @@ class TestWhitening(BaseTester):
self.gradcheck(whitening_describe, (patches, in_dims), nondet_tol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, in_dims = 1, 175
patches = torch.rand(batch_size, in_dims).to(device)
@@ -488,7 +484,6 @@ class TestMKDDescriptor(BaseTester):
self.gradcheck(mkd_describe, (patches, ps), nondet_tol=1e-4)
@pytest.mark.skip("neither dict, nor nn.ModuleDict works")
- @pytest.mark.jit()
def test_jit(self, device, dtype):
batch_size, channels, ps = 1, 1, 19
patches = torch.rand(batch_size, channels, ps, ps).to(device)
diff --git a/tests/feature/test_sosnet.py b/tests/feature/test_sosnet.py
index 7e37c4624..4337fa780 100644
--- a/tests/feature/test_sosnet.py
+++ b/tests/feature/test_sosnet.py
@@ -43,7 +43,6 @@ class TestSOSNet(BaseTester):
sosnet = SOSNet(pretrained=False).to(patches.device, patches.dtype)
self.gradcheck(sosnet, (patches,), eps=1e-4, atol=1e-4)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/feature/test_tfeat.py b/tests/feature/test_tfeat.py
index f656fb7fd..edecff9e8 100644
--- a/tests/feature/test_tfeat.py
+++ b/tests/feature/test_tfeat.py
@@ -52,7 +52,6 @@ class TestTFeat(BaseTester):
self.gradcheck(tfeat, (patches,), eps=1e-2, atol=1e-2)
@pytest.mark.slow
- @pytest.mark.jit()
def test_jit(self, device, dtype):
B, C, H, W = 2, 1, 32, 32
patches = torch.ones(B, C, H, W, device=device, dtype=dtype)
diff --git a/tests/geometry/test_homography.py b/tests/geometry/test_homography.py
index 593566628..04356774a 100644
--- a/tests/geometry/test_homography.py
+++ b/tests/geometry/test_homography.py
@@ -258,7 +258,6 @@ class TestFindHomographyDLT(BaseTester):
atol = 2e-3
self.assert_close(kornia.geometry.transform_points(dst_homo_src, points_src), points_dst, rtol=rtol, atol=atol)
- @pytest.mark.grad()
def test_gradcheck(self, device):
points_src = torch.rand(1, 10, 2, device=device, dtype=torch.float64, requires_grad=True)
points_dst = torch.rand_like(points_src)
@@ -266,7 +265,6 @@ class TestFindHomographyDLT(BaseTester):
self.gradcheck(find_homography_dlt, (points_src, points_dst, weights), rtol=1e-6, atol=1e-6)
- @pytest.mark.grad()
def test_gradcheck_lu(self, device):
points_src = torch.rand(1, 10, 2, device=device, dtype=torch.float64, requires_grad=True)
@@ -410,7 +408,6 @@ class TestFindHomographyFromLinesDLT(BaseTester):
kornia.geometry.transform_points(dst_homo_src, points_src_st), points_dst_st, rtol=rtol, atol=atol
)
- @pytest.mark.grad()
def test_gradcheck(self, device):
points_src_st = torch.rand(1, 10, 2, device=device, dtype=torch.float64, requires_grad=True)
points_src_end = torch.rand(1, 10, 2, device=device, dtype=torch.float64, requires_grad=True)
@@ -461,7 +458,6 @@ class TestFindHomographyDLTIter(BaseTester):
atol = 2e-3 if (device.type == "cuda" and dtype == torch.float32) else 1e-4
self.assert_close(kornia.geometry.transform_points(dst_homo_src, points_src), points_dst, rtol=1e-3, atol=atol)
- @pytest.mark.grad()
def test_gradcheck(self, device):
torch.manual_seed(0)
points_src = torch.rand(1, 10, 2, device=device, dtype=torch.float64, requires_grad=True)
@@ -469,7 +465,6 @@ class TestFindHomographyDLTIter(BaseTester):
weights = torch.ones_like(points_src)[..., 0]
self.gradcheck(find_homography_dlt_iterated, (points_src, points_dst, weights), rtol=1e-6, atol=1e-6)
- @pytest.mark.grad()
@pytest.mark.parametrize("batch_size", [1, 2])
def test_dirty_points_and_gradcheck(self, batch_size, device, dtype):
# generate input data
diff --git a/tests/geometry/transform/test_thin_plate_spline.py b/tests/geometry/transform/test_thin_plate_spline.py
index 8fabb23c9..f90e8c492 100644
--- a/tests/geometry/transform/test_thin_plate_spline.py
+++ b/tests/geometry/transform/test_thin_plate_spline.py
@@ -66,7 +66,6 @@ class TestTransformParameters(BaseTester):
src = torch.rand(batch_size, 5)
assert kornia.geometry.transform.get_tps_transform(src, src)
- @pytest.mark.grad()
@pytest.mark.parametrize("batch_size", [1, 3])
@pytest.mark.parametrize("requires_grad", [True, False])
def test_gradcheck(self, batch_size, device, dtype, requires_grad):
@@ -78,7 +77,6 @@ class TestTransformParameters(BaseTester):
kornia.geometry.transform.get_tps_transform, (src, dst), raise_exception=True, fast_mode=True
)
- @pytest.mark.jit()
@pytest.mark.parametrize("batch_size", [1, 3])
def test_jit(self, batch_size, device, dtype):
src, dst = _sample_points(batch_size, device)
@@ -139,7 +137,6 @@ class TestWarpPoints(BaseTester):
affine_bad = torch.rand(batch_size, 3)
assert kornia.geometry.transform.warp_points_tps(src, src, kernel, affine_bad)
- @pytest.mark.grad()
@pytest.mark.parametrize("batch_size", [1, 3])
@pytest.mark.parametrize("requires_grad", [True, False])
def test_gradcheck(self, batch_size, device, dtype, requires_grad):
@@ -152,7 +149,6 @@ class TestWarpPoints(BaseTester):
kornia.geometry.transform.warp_points_tps, (src, dst, kernel, affine), raise_exception=True, fast_mode=True
)
- @pytest.mark.jit()
@pytest.mark.parametrize("batch_size", [1, 3])
def test_jit(self, batch_size, device, dtype):
src, dst = _sample_points(batch_size, device)
@@ -225,7 +221,6 @@ class TestWarpImage(BaseTester):
affine_bad = torch.rand(batch_size, 3)
assert kornia.geometry.transform.warp_image_tps(image, dst, kernel, affine_bad)
- @pytest.mark.grad()
@pytest.mark.parametrize("batch_size", [1, 3])
def test_gradcheck(self, batch_size, device, dtype):
if device.type != "cpu":
@@ -253,7 +248,6 @@ class TestWarpImage(BaseTester):
fast_mode=True,
)
- @pytest.mark.jit()
@pytest.mark.parametrize("batch_size", [1, 3])
def test_jit(self, batch_size, device, dtype):
src, dst = _sample_points(batch_size, device)
diff --git a/tests/losses/test_cauchy.py b/tests/losses/test_cauchy.py
index 6be040812..d1e38e076 100644
--- a/tests/losses/test_cauchy.py
+++ b/tests/losses/test_cauchy.py
@@ -74,7 +74,6 @@ class TestCauchyLoss(BaseTester):
actual = kornia.losses.cauchy_loss(img, img, reduction="mean")
assert actual.shape == ()
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img1 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
img2 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_charbonnier.py b/tests/losses/test_charbonnier.py
index b3dd2cbe4..c8de519df 100644
--- a/tests/losses/test_charbonnier.py
+++ b/tests/losses/test_charbonnier.py
@@ -74,7 +74,6 @@ class TestCharbonnierLoss(BaseTester):
actual = kornia.losses.charbonnier_loss(img, img, reduction="mean")
assert actual.shape == ()
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img1 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
img2 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_depth_smoothness.py b/tests/losses/test_depth_smoothness.py
index 44ed66b1a..31f1ff28e 100644
--- a/tests/losses/test_depth_smoothness.py
+++ b/tests/losses/test_depth_smoothness.py
@@ -81,7 +81,6 @@ class TestDepthSmoothnessLoss(BaseTester):
self.assert_close(op(image, depth), op_module(image, depth))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
image = torch.rand(1, 2, 3, 4, device=device, dtype=torch.float64)
depth = torch.rand(1, 2, 3, 4, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_dice.py b/tests/losses/test_dice.py
index 50cd3eb77..fc6eb5185 100644
--- a/tests/losses/test_dice.py
+++ b/tests/losses/test_dice.py
@@ -194,7 +194,6 @@ class TestDiceLoss(BaseTester):
loss = criterion(logits, labels)
self.assert_close(loss, expected_loss, rtol=1e-3, atol=1e-3)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
num_classes = 3
logits = torch.rand(2, num_classes, 3, 2, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_divergence.py b/tests/losses/test_divergence.py
index a99d055a0..6b8018d28 100644
--- a/tests/losses/test_divergence.py
+++ b/tests/losses/test_divergence.py
@@ -99,7 +99,6 @@ class TestDivergenceLoss(BaseTester):
expected = torch.tensor(expected).to(device, dtype)
self.assert_close(actual, expected)
- @pytest.mark.grad()
def test_gradcheck_kl(self, device, dtype):
dtype = torch.float64
pred = torch.rand(1, 1, 10, 16, device=device, dtype=dtype)
@@ -108,7 +107,6 @@ class TestDivergenceLoss(BaseTester):
# evaluate function gradient
self.gradcheck(kornia.losses.kl_div_loss_2d, (pred, target))
- @pytest.mark.grad()
def test_gradcheck_js(self, device, dtype):
dtype = torch.float64
pred = torch.rand(1, 1, 10, 16, device=device, dtype=dtype)
diff --git a/tests/losses/test_focal_loss.py b/tests/losses/test_focal_loss.py
index 9ccf1efd0..ecb4d0ea3 100644
--- a/tests/losses/test_focal_loss.py
+++ b/tests/losses/test_focal_loss.py
@@ -107,7 +107,6 @@ class TestBinaryFocalLossWithLogits(BaseTester):
expected = op(logits, labels, *args)
self.assert_close(actual, expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
logits = torch.rand(2, 3, 2, device=device, dtype=torch.float64)
labels = torch.rand(2, 3, 2, device=device, dtype=torch.float64)
@@ -116,7 +115,6 @@ class TestBinaryFocalLossWithLogits(BaseTester):
op = kornia.losses.binary_focal_loss_with_logits
self.gradcheck(op, (logits, labels, *args))
- @pytest.mark.grad()
def test_gradcheck_ignore_index(self, device, dtype):
logits = torch.rand(2, 3, 2, device=device, dtype=torch.float64)
labels = torch.rand(2, 3, 2, device=device, dtype=torch.float64)
@@ -232,7 +230,6 @@ class TestFocalLoss(BaseTester):
expected = op(logits, labels, *args)
self.assert_close(actual, expected)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
num_classes = 3
logits = torch.rand(2, num_classes, 3, 2, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_geman_macclure.py b/tests/losses/test_geman_macclure.py
index 9ee106e23..feb53040d 100644
--- a/tests/losses/test_geman_macclure.py
+++ b/tests/losses/test_geman_macclure.py
@@ -74,7 +74,6 @@ class TestGemanMcclureLossLoss(BaseTester):
actual = kornia.losses.geman_mcclure_loss(img, img, reduction="mean")
assert actual.shape == ()
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img1 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
img2 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_hd.py b/tests/losses/test_hd.py
index 3feac6ea2..5b500de8e 100644
--- a/tests/losses/test_hd.py
+++ b/tests/losses/test_hd.py
@@ -92,7 +92,6 @@ class TestHausdorffLoss(BaseTester):
@pytest.mark.parametrize(
"hd,shape", [[kornia.losses.HausdorffERLoss, (5, 5)], [kornia.losses.HausdorffERLoss3D, (5, 5, 5)]]
)
- @pytest.mark.grad()
def test_gradcheck(self, hd, shape, device, dtype):
num_classes = 3
logits = torch.rand(2, num_classes, *shape, device=device)
diff --git a/tests/losses/test_lovaz_hinge.py b/tests/losses/test_lovaz_hinge.py
index 90d71c3de..6a98c83dd 100644
--- a/tests/losses/test_lovaz_hinge.py
+++ b/tests/losses/test_lovaz_hinge.py
@@ -63,7 +63,6 @@ class TestLovaszHingeLoss(BaseTester):
loss = criterion(prediction, labels)
self.assert_close(loss, torch.zeros_like(loss), rtol=1e-3, atol=1e-3)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
dtype = torch.float64
num_classes = 1
diff --git a/tests/losses/test_lovaz_softmax.py b/tests/losses/test_lovaz_softmax.py
index 9ce3689ba..45bc640f4 100644
--- a/tests/losses/test_lovaz_softmax.py
+++ b/tests/losses/test_lovaz_softmax.py
@@ -94,7 +94,6 @@ class TestLovaszSoftmaxLoss(BaseTester):
self.assert_close(loss, 0.5 * torch.ones_like(loss), rtol=1e-3, atol=1e-3)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
num_classes = 4
logits = torch.rand(2, num_classes, 3, 2, device=device, dtype=torch.float64)
diff --git a/tests/losses/test_psnr.py b/tests/losses/test_psnr.py
index 5a7520796..7342a7997 100644
--- a/tests/losses/test_psnr.py
+++ b/tests/losses/test_psnr.py
@@ -75,7 +75,6 @@ class TestPSNRLoss(BaseTester):
self.assert_close(op(*args), op_module(pred, target))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
dtype = torch.float64
pred = torch.rand(2, 3, 3, 2, device=device, dtype=dtype)
diff --git a/tests/losses/test_ssim.py b/tests/losses/test_ssim.py
index f673f1d45..88f88020c 100644
--- a/tests/losses/test_ssim.py
+++ b/tests/losses/test_ssim.py
@@ -65,7 +65,6 @@ class TestSSIMLoss(BaseTester):
self.assert_close(op(*args), op_module(*args[:2]))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
# input data
window_size = 3
@@ -117,7 +116,6 @@ class TestMS_SSIMLoss(BaseTester):
self.assert_close(loss.sum().item(), 0.0)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
# input data
dtype = torch.float64
@@ -196,7 +194,6 @@ class TestSSIM3DLoss(BaseTester):
self.assert_close(op(*args), op_module(*args[:2]))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
# input data
img = torch.rand(1, 1, 5, 4, 3, device=device)
diff --git a/tests/losses/test_total_variation.py b/tests/losses/test_total_variation.py
index 5cc3200cf..e7cbea84e 100644
--- a/tests/losses/test_total_variation.py
+++ b/tests/losses/test_total_variation.py
@@ -164,7 +164,6 @@ class TestTotalVariation(BaseTester):
self.assert_close(op(image), op_module(image))
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
dtype = torch.float64
image = torch.rand(1, 2, 3, 4, device=device, dtype=dtype)
diff --git a/tests/losses/test_tversky.py b/tests/losses/test_tversky.py
index 242a825b1..5a9880887 100644
--- a/tests/losses/test_tversky.py
+++ b/tests/losses/test_tversky.py
@@ -80,7 +80,6 @@ class TestTverskyLoss(BaseTester):
loss = criterion(logits, labels)
self.assert_close(loss, expected_loss, rtol=1e-3, atol=1e-3)
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
num_classes = 3
alpha, beta = 0.5, 0.5 # for tversky loss
diff --git a/tests/losses/test_welcsh.py b/tests/losses/test_welcsh.py
index 9b1953aae..6fbe1c32f 100644
--- a/tests/losses/test_welcsh.py
+++ b/tests/losses/test_welcsh.py
@@ -42,7 +42,6 @@ class TestWelschLoss(BaseTester):
actual = kornia.losses.WelschLoss(reduction="mean")(img, img)
assert actual.shape == ()
- @pytest.mark.grad()
def test_gradcheck(self, device, dtype):
img1 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
img2 = torch.rand(2, 3, 3, 3, device=device, dtype=torch.float64)
diff --git a/tests/morphology/test_bottom_hat.py b/tests/morphology/test_bottom_hat.py
index dc9985c36..1266f91a7 100644
--- a/tests/morphology/test_bottom_hat.py
+++ b/tests/morphology/test_bottom_hat.py
@@ -111,7 +111,6 @@ class TestBottomHat(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert bottom_hat(sample, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = bottom_hat
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_closing.py b/tests/morphology/test_closing.py
index 946738f74..1e8135a67 100644
--- a/tests/morphology/test_closing.py
+++ b/tests/morphology/test_closing.py
@@ -111,7 +111,6 @@ class TestClosing(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert closing(tensor, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = closing
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_dilation.py b/tests/morphology/test_dilation.py
index 997eec8f4..06920e0da 100644
--- a/tests/morphology/test_dilation.py
+++ b/tests/morphology/test_dilation.py
@@ -156,7 +156,6 @@ class TestDilate(BaseTester):
# Results should differ when the anchor point changes
assert not torch.equal(out_default, out_custom)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = dilation
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_erosion.py b/tests/morphology/test_erosion.py
index 67d44ac26..959f2d25f 100644
--- a/tests/morphology/test_erosion.py
+++ b/tests/morphology/test_erosion.py
@@ -143,7 +143,6 @@ class TestErode(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert erosion(tensor, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = erosion
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_gradient.py b/tests/morphology/test_gradient.py
index 1fcf9124b..e51867864 100644
--- a/tests/morphology/test_gradient.py
+++ b/tests/morphology/test_gradient.py
@@ -111,7 +111,6 @@ class TestGradient(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert gradient(tensor, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = gradient
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_opening.py b/tests/morphology/test_opening.py
index c0c723e82..84eb0e72c 100644
--- a/tests/morphology/test_opening.py
+++ b/tests/morphology/test_opening.py
@@ -111,7 +111,6 @@ class TestOpening(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert opening(tensor, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = opening
op_script = torch.jit.script(op)
diff --git a/tests/morphology/test_top_hat.py b/tests/morphology/test_top_hat.py
index 186dab980..2c47b32a7 100644
--- a/tests/morphology/test_top_hat.py
+++ b/tests/morphology/test_top_hat.py
@@ -111,7 +111,6 @@ class TestTopHat(BaseTester):
test = torch.ones(2, 3, 4, device=device, dtype=dtype)
assert top_hat(sample, test)
- @pytest.mark.jit()
def test_jit(self, device, dtype):
op = top_hat
op_script = torch.jit.script(op)