Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Add/ensure support for pytorch 1.13.0 (#2035)

João Gustavo A. Amorim43d8a26e40e6
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.yml
index d09205102..73d40798a 100644
--- a/.github/workflows/pr_test_cpu.yml
+++ b/.github/workflows/pr_test_cpu.yml
@@ -19,7 +19,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos]
python-version: ['3.7', '3.8']
- pytorch-version: ['1.9.1', '1.12.1']
+ pytorch-version: ['1.9.1', '1.13.0']
pytorch-dtype: ['float16', 'float32', 'float64']
steps:
diff --git a/.github/workflows/pr_test_typing.yml b/.github/workflows/pr_test_typing.yml
index a44b73f08..01d83382b 100644
--- a/.github/workflows/pr_test_typing.yml
+++ b/.github/workflows/pr_test_typing.yml
@@ -19,7 +19,7 @@ jobs:
matrix:
os: [ubuntu-latest]
python-version: ['3.7']
- pytorch-version: ['1.9.1', '1.12.1']
+ pytorch-version: ['1.9.1', '1.13.0']
steps:
- name: Checkout kornia
diff --git a/test/utils/test_helpers.py b/test/utils/test_helpers.py
index cd86c2ac1..567c3d33a 100644
--- a/test/utils/test_helpers.py
+++ b/test/utils/test_helpers.py
@@ -104,12 +104,12 @@ class TestSvdCast:
class TestSolveCast:
def test_smoke(self, device, dtype):
+ torch.manual_seed(0)
A = torch.randn(2, 3, 1, 4, 4, device=device, dtype=dtype)
B = torch.randn(2, 3, 1, 4, 6, device=device, dtype=dtype)
X = _torch_solve_cast(A, B)
error = torch.dist(B, A.matmul(X))
-
tol_val: float = 1e-1 if dtype == torch.float16 else 1e-4
assert_close(error, torch.zeros_like(error), atol=tol_val, rtol=tol_val)
@@ -148,10 +148,6 @@ class TestInverseWithMask:
assert_close(y, y_expected)
assert torch.equal(mask, torch.ones_like(mask))
- @pytest.mark.skipif(
- (int(torch.__version__.split('.')[0]) == 1) and (int(torch.__version__.split('.')[1]) < 9),
- reason='<1.9.0 not supporting',
- )
def test_all_bad(self, device, dtype):
A = torch.ones(10, 3, 3, device=device, dtype=dtype)
X, mask = safe_inverse_with_mask(A)