Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

[pre-commit.ci] pre-commit suggestions (#3144)

pre-commit-ci[bot]21de81db5ce8
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1c85e8ceb..4f0ba564d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,7 +15,7 @@ repos:
exclude: ^$|.devcontainer
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.9.10
+ rev: v0.11.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
diff --git a/kornia/augmentation/auto/operations/base.py b/kornia/augmentation/auto/operations/base.py
index 58a3b53c1..edcfb4f6f 100644
--- a/kornia/augmentation/auto/operations/base.py
+++ b/kornia/augmentation/auto/operations/base.py
@@ -21,6 +21,7 @@ import torch
from torch import nn
from torch.autograd import Function
from torch.distributions import Bernoulli, RelaxedBernoulli
+from typing_extensions import Self
from kornia.augmentation.base import _AugmentationBase
from kornia.core import Module, Tensor
@@ -129,12 +130,12 @@ class OperationBase(Module):
else:
self.op._p_gen = Bernoulli(self.probability)
- def train(self: T, mode: bool = True) -> T:
+ def train(self, mode: bool = True) -> Self:
self._update_probability_gen(relaxation=mode)
return super().train(mode=mode)
- def eval(self: T) -> T:
+ def eval(self) -> Self:
return self.train(False)
def forward_parameters(self, batch_shape: torch.Size, mag: Optional[Tensor] = None) -> Dict[str, Tensor]: