🐍 Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
chore (ci): tests on torch `2.5.1` (#3070)
João G. Atkinson A.8fb11139bea5
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.ymlindex 5e8de4531..6a0cd7584 100644--- a/.github/workflows/pr_test_cpu.yml+++ b/.github/workflows/pr_test_cpu.yml@@ -19,7 +19,7 @@ jobs:outputs:hash: ${{ steps.hashid.outputs.weights-hash }}steps:- - uses: kornia/workflows/.github/actions/[email protected]+ - uses: kornia/workflows/.github/actions/[email protected]- uses: actions/cache@v4id: cache-weightswith:@@ -43,11 +43,11 @@ jobs:os: ['Ubuntu-latest', 'Windows-latest']pytorch-dtype: ['float32', 'float64']- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: ${{ matrix.os }}python-version: '["3.9", "3.12"]'- pytorch-version: '["1.9.1", "2.4.0"]'+ pytorch-version: '["1.9.1", "2.5.1"]'pytorch-dtype: ${{ matrix.pytorch-dtype }}cache-path: weights/cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}@@ -57,7 +57,7 @@ jobs:tests-cpu-macos:needs: [pre-tests]- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: 'MacOS-latest'python-version: '["3.9", "3.12"]'@@ -71,7 +71,7 @@ jobs:coverage:needs: [pre-tests]- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:cache-path: weights/cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}@@ -80,14 +80,14 @@ jobs:model-weights-typing:- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]tutorials:- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]docs:needs: [pre-tests]- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:python-version: '["3.11"]'cache-path: weights/@@ -116,7 +116,7 @@ jobs:os: ['Ubuntu-latest', 'Windows-latest'] #, 'MacOS-latest'] add it when https://github.com/pytorch/pytorch/pull/89262 be mergedpytorch-dtype: ['float32', 'float64']- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: ${{ matrix.os }}pytorch-version: '["nightly"]'diff --git a/.github/workflows/scheduled_test_cpu.yml b/.github/workflows/scheduled_test_cpu.ymlindex 8ecdda734..5e8eb9c9d 100644--- a/.github/workflows/scheduled_test_cpu.yml+++ b/.github/workflows/scheduled_test_cpu.yml@@ -17,7 +17,7 @@ jobs:outputs:hash: ${{ steps.hashid.outputs.weights-hash }}steps:- - uses: kornia/workflows/.github/actions/[email protected]+ - uses: kornia/workflows/.github/actions/[email protected]- uses: actions/cache@v4id: cache-weightswith:@@ -41,11 +41,11 @@ jobs:# os: ['Ubuntu-latest', 'Windows-latest', 'MacOS-latest']pytorch-dtype: ['float32', 'float64']- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: 'Ubuntu-latest'python-version: '["3.9", "3.10", "3.11", "3.12"]'- pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1", "2.4.0"]'+ pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.1", "2.4.0", "2.5.1"]'pytorch-dtype: ${{ matrix.pytorch-dtype }}pytest-extra: '--runslow'cache-path: weights/@@ -61,11 +61,11 @@ jobs:matrix:pytorch-dtype: ['float32', 'float64']- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: 'Windows-latest'python-version: '["3.12"]'- pytorch-version: '["1.9.1", "2.4.0"]'+ pytorch-version: '["1.9.1", "2.5.1"]'pytorch-dtype: ${{ matrix.pytorch-dtype }}cache-path: weights/cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}@@ -80,7 +80,7 @@ jobs:matrix:pytorch-dtype: ['float32', 'float64']- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:os: 'MacOS-latest'pytorch-dtype: ${{ matrix.pytorch-dtype }}@@ -92,7 +92,7 @@ jobs:coverage:needs: [pre-tests]- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:cache-path: weights/cache-key: model-weights-${{ needs.pre-tests.outputs.hash }}@@ -101,14 +101,14 @@ jobs:model-weights-typing:- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]tutorials:- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]docs:needs: [pre-tests]- uses: kornia/workflows/.github/workflows/[email protected]+ uses: kornia/workflows/.github/workflows/[email protected]with:python-version: '["3.11"]'cache-path: weights/diff --git a/kornia/core/mixin/onnx.py b/kornia/core/mixin/onnx.pyindex 7a4736c65..c1c2488bf 100644--- a/kornia/core/mixin/onnx.py+++ b/kornia/core/mixin/onnx.py@@ -113,9 +113,9 @@ class ONNXExportMixin:onnx_buffer = io.BytesIO()torch.onnx.export(- model or self, # type: ignore- dummy_input,- onnx_buffer,+ model or self, # type: ignore[arg-type]+ dummy_input, # type: ignore[arg-type]+ onnx_buffer, # type: ignore[arg-type]**default_args,)onnx_buffer.seek(0)diff --git a/kornia/feature/lightglue.py b/kornia/feature/lightglue.pyindex 12a989957..0454c900d 100644--- a/kornia/feature/lightglue.py+++ b/kornia/feature/lightglue.py@@ -468,7 +468,7 @@ class LightGlue(Module):)for i in range(self.conf.n_layers):- self.transformers[i].masked_forward = torch.compile(+ self.transformers[i].masked_forward = torch.compile( # type: ignore[assignment]self.transformers[i].masked_forward, mode=mode, fullgraph=True)diff --git a/kornia/feature/sold2/backbones.py b/kornia/feature/sold2/backbones.pyindex 7508bd086..c9499c7e0 100644--- a/kornia/feature/sold2/backbones.py+++ b/kornia/feature/sold2/backbones.py@@ -132,15 +132,15 @@ class Hourglass(Module):return nn.ModuleList(hgl)def _hour_glass_forward(self, n: int, x: Tensor) -> Tensor:- up1 = self.hg[n - 1][0](x)+ up1 = self.hg[n - 1][0](x) # type: ignore[index]low1 = F.max_pool2d(x, 2, stride=2)- low1 = self.hg[n - 1][1](low1)+ low1 = self.hg[n - 1][1](low1) # type: ignore[index]if n > 1:low2 = self._hour_glass_forward(n - 1, low1)else:- low2 = self.hg[n - 1][3](low1)- low3 = self.hg[n - 1][2](low2)+ low2 = self.hg[n - 1][3](low1) # type: ignore[index]+ low3 = self.hg[n - 1][2](low2) # type: ignore[index]up2 = F.interpolate(low3, size=up1.shape[2:])out = up1 + up2return out