Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Pre commit update hooks (#2844)

João Gustavo A. Amorimdf992d864dfe
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index db623ad53..fc766ec08 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -20,7 +20,7 @@ repos:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.2.2
+ rev: v0.3.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
diff --git a/kornia/augmentation/auto/autoaugment/ops.py b/kornia/augmentation/auto/autoaugment/ops.py
index 12320c056..01c644cc6 100644
--- a/kornia/augmentation/auto/autoaugment/ops.py
+++ b/kornia/augmentation/auto/autoaugment/ops.py
@@ -1,4 +1,5 @@
"""AutoAugment operation wrapper."""
+
from kornia.augmentation.auto.operations import (
AutoContrast,
Brightness,
diff --git a/kornia/augmentation/auto/rand_augment/ops.py b/kornia/augmentation/auto/rand_augment/ops.py
index 2a7518397..9d0cc70c5 100644
--- a/kornia/augmentation/auto/rand_augment/ops.py
+++ b/kornia/augmentation/auto/rand_augment/ops.py
@@ -1,4 +1,5 @@
"""RandAugment operation wrapper."""
+
from kornia.augmentation.auto.operations import (
AutoContrast,
Brightness,
diff --git a/kornia/color/lab.py b/kornia/color/lab.py
index 69c6bf86c..ee1215274 100644
--- a/kornia/color/lab.py
+++ b/kornia/color/lab.py
@@ -3,7 +3,6 @@
https://github.com/scikit-image/scikit-image/blob/a48bf6774718c64dade4548153ae16065b595ca9/skimage/color/colorconv.py
"""
-
import torch
from torch import nn
diff --git a/kornia/color/luv.py b/kornia/color/luv.py
index 58309ae3d..2b9c55c7e 100644
--- a/kornia/color/luv.py
+++ b/kornia/color/luv.py
@@ -3,7 +3,6 @@
https://github.com/scikit-image/scikit-image/blob/a48bf6774718c64dade4548153ae16065b595ca9/skimage/color/colorconv.py
"""
-
from typing import Tuple
import torch
diff --git a/kornia/contrib/classification.py b/kornia/contrib/classification.py
index 8bda9d01a..f0ce44cd8 100644
--- a/kornia/contrib/classification.py
+++ b/kornia/contrib/classification.py
@@ -1,4 +1,5 @@
"""Module containing utilities for classification."""
+
import torch
from torch import nn
diff --git a/kornia/contrib/models/rt_detr/architecture/resnet_d.py b/kornia/contrib/models/rt_detr/architecture/resnet_d.py
index d144e200b..57fa171c8 100644
--- a/kornia/contrib/models/rt_detr/architecture/resnet_d.py
+++ b/kornia/contrib/models/rt_detr/architecture/resnet_d.py
@@ -3,6 +3,7 @@
Based on the code from https://github.com/pytorch/vision/blob/v0.15.1/torchvision/models/resnet.py
https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.6/ppdet/modeling/backbones/resnet.py
"""
+
from __future__ import annotations
from torch import nn
diff --git a/kornia/contrib/models/sam/architecture/common.py b/kornia/contrib/models/sam/architecture/common.py
index 1525ddf8e..e24a5113c 100644
--- a/kornia/contrib/models/sam/architecture/common.py
+++ b/kornia/contrib/models/sam/architecture/common.py
@@ -3,6 +3,7 @@
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/common.py
"""
+
from __future__ import annotations
from typing import Any
diff --git a/kornia/contrib/models/sam/architecture/image_encoder.py b/kornia/contrib/models/sam/architecture/image_encoder.py
index 8085a7484..c9da29323 100644
--- a/kornia/contrib/models/sam/architecture/image_encoder.py
+++ b/kornia/contrib/models/sam/architecture/image_encoder.py
@@ -3,6 +3,7 @@
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/image_encoder.py
"""
+
from __future__ import annotations
from typing import Optional
diff --git a/kornia/contrib/models/sam/architecture/mask_decoder.py b/kornia/contrib/models/sam/architecture/mask_decoder.py
index dbf1d7dfd..c7609ae43 100644
--- a/kornia/contrib/models/sam/architecture/mask_decoder.py
+++ b/kornia/contrib/models/sam/architecture/mask_decoder.py
@@ -3,6 +3,7 @@
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/mask_decoder.py
"""
+
from __future__ import annotations
import torch
diff --git a/kornia/contrib/models/sam/architecture/prompt_encoder.py b/kornia/contrib/models/sam/architecture/prompt_encoder.py
index a386927c3..9e41d20fe 100644
--- a/kornia/contrib/models/sam/architecture/prompt_encoder.py
+++ b/kornia/contrib/models/sam/architecture/prompt_encoder.py
@@ -3,6 +3,7 @@
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/prompt_encoder.py
"""
+
from __future__ import annotations
from math import pi
diff --git a/kornia/contrib/models/sam/architecture/transformer.py b/kornia/contrib/models/sam/architecture/transformer.py
index af96dd233..2fe202547 100644
--- a/kornia/contrib/models/sam/architecture/transformer.py
+++ b/kornia/contrib/models/sam/architecture/transformer.py
@@ -3,6 +3,7 @@
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/transformer.py
"""
+
from __future__ import annotations
import math
diff --git a/kornia/contrib/models/sam/model.py b/kornia/contrib/models/sam/model.py
index b6c225500..f9cbbfa14 100644
--- a/kornia/contrib/models/sam/model.py
+++ b/kornia/contrib/models/sam/model.py
@@ -6,6 +6,7 @@ anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/build_sa
https://github.com/facebookresearch/segment-
anything/blob/3518c86b78b3bc9cf4fbe3d18e682fad1c79dc51/segment_anything/modeling/sam.py
"""
+
from __future__ import annotations
import warnings
diff --git a/kornia/contrib/vit.py b/kornia/contrib/vit.py
index 4854618df..55aef9499 100644
--- a/kornia/contrib/vit.py
+++ b/kornia/contrib/vit.py
@@ -6,6 +6,7 @@ Based on: `https://towardsdatascience.com/implementing-visualttransformer-in-pyt
Added some tricks from: `https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py`
"""
+
from __future__ import annotations
from typing import Any, Callable
diff --git a/kornia/core/check.py b/kornia/core/check.py
index cf2148fd6..38d729ab7 100644
--- a/kornia/core/check.py
+++ b/kornia/core/check.py
@@ -1,4 +1,5 @@
"""The testing package contains testing-specific utilities."""
+
from __future__ import annotations
from typing import Any, Optional, Sequence, TypeVar, cast
diff --git a/kornia/feature/hardnet.py b/kornia/feature/hardnet.py
index 938fac637..da665f957 100644
--- a/kornia/feature/hardnet.py
+++ b/kornia/feature/hardnet.py
@@ -9,9 +9,9 @@ from kornia.utils.helpers import is_mps_tensor_safe, map_location_to_cpu
urls: Dict[str, str] = {}
urls["hardnet++"] = "https://github.com/DagnyT/hardnet/raw/master/pretrained/pretrained_all_datasets/HardNet++.pth"
-urls[
- "liberty_aug"
-] = "https://github.com/DagnyT/hardnet/raw/master/pretrained/train_liberty_with_aug/checkpoint_liberty_with_aug.pth"
+urls["liberty_aug"] = (
+ "https://github.com/DagnyT/hardnet/raw/master/pretrained/train_liberty_with_aug/checkpoint_liberty_with_aug.pth"
+)
urls["hardnet8v2"] = "http://cmp.felk.cvut.cz/~mishkdmy/hardnet8v2.pt"
diff --git a/kornia/feature/sold2/backbones.py b/kornia/feature/sold2/backbones.py
index e7472ee20..a2721fd25 100644
--- a/kornia/feature/sold2/backbones.py
+++ b/kornia/feature/sold2/backbones.py
@@ -1,4 +1,5 @@
"""Implements several backbone networks."""
+
import functools
import operator
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Type, Union
diff --git a/kornia/geometry/camera/distortion_affine.py b/kornia/geometry/camera/distortion_affine.py
index 0142dbafb..537dfcc00 100644
--- a/kornia/geometry/camera/distortion_affine.py
+++ b/kornia/geometry/camera/distortion_affine.py
@@ -1,4 +1,5 @@
"""Module containing the affine distortion model."""
+
# inspired by: https://github.com/farm-ng/sophus-rs/blob/main/src/sensor/affine.rs
import kornia.core as ops
from kornia.core import Tensor
diff --git a/kornia/geometry/camera/projection_orthographic.py b/kornia/geometry/camera/projection_orthographic.py
index 54ef4c150..244035fa6 100644
--- a/kornia/geometry/camera/projection_orthographic.py
+++ b/kornia/geometry/camera/projection_orthographic.py
@@ -1,4 +1,5 @@
"""Module containing functions for orthographic projection."""
+
# inspired by: https://github.com/farm-ng/sophus-rs/blob/main/src/sensor/ortho_camera.rs
import kornia.core as ops
from kornia.core import Tensor
diff --git a/kornia/geometry/camera/projection_z1.py b/kornia/geometry/camera/projection_z1.py
index 4a330d32d..adbc05da2 100644
--- a/kornia/geometry/camera/projection_z1.py
+++ b/kornia/geometry/camera/projection_z1.py
@@ -1,4 +1,5 @@
"""Module for the projection of points in the canonical z=1 plane."""
+
# inspired by: https://github.com/farm-ng/sophus-rs/blob/main/src/sensor/perspective_camera.rs
from __future__ import annotations
diff --git a/kornia/geometry/depth.py b/kornia/geometry/depth.py
index 26879c20e..e6a343578 100644
--- a/kornia/geometry/depth.py
+++ b/kornia/geometry/depth.py
@@ -1,4 +1,5 @@
"""Module containing operators to work on RGB-Depth images."""
+
from __future__ import annotations
from typing import Optional
diff --git a/kornia/geometry/epipolar/essential.py b/kornia/geometry/epipolar/essential.py
index e87adfa54..5f33467e7 100644
--- a/kornia/geometry/epipolar/essential.py
+++ b/kornia/geometry/epipolar/essential.py
@@ -1,4 +1,5 @@
"""Module containing functionalities for the Essential matrix."""
+
from typing import Optional, Tuple
import torch
diff --git a/kornia/geometry/epipolar/projection.py b/kornia/geometry/epipolar/projection.py
index 90572916f..76bcb86de 100644
--- a/kornia/geometry/epipolar/projection.py
+++ b/kornia/geometry/epipolar/projection.py
@@ -1,4 +1,5 @@
"""Module for image projections."""
+
from typing import Tuple, Union
import torch
diff --git a/kornia/geometry/epipolar/scene.py b/kornia/geometry/epipolar/scene.py
index 2ecd138a9..a0a66da71 100644
--- a/kornia/geometry/epipolar/scene.py
+++ b/kornia/geometry/epipolar/scene.py
@@ -1,4 +1,5 @@
"""Module to generate synthetic 3d scenes."""
+
import math
from typing import Dict
diff --git a/kornia/geometry/liegroup/se2.py b/kornia/geometry/liegroup/se2.py
index 659ce3f99..1d5e07e4a 100644
--- a/kornia/geometry/liegroup/se2.py
+++ b/kornia/geometry/liegroup/se2.py
@@ -99,12 +99,10 @@ class Se2(Module):
return Se2(_r, _t)
@overload
- def __mul__(self, right: Se2) -> Se2:
- ...
+ def __mul__(self, right: Se2) -> Se2: ...
@overload
- def __mul__(self, right: Tensor) -> Tensor:
- ...
+ def __mul__(self, right: Tensor) -> Tensor: ...
def __mul__(self, right: Se2 | Tensor) -> Se2 | Tensor:
"""Compose two Se2 transformations.
diff --git a/kornia/geometry/liegroup/so2.py b/kornia/geometry/liegroup/so2.py
index d13e50688..cfce67a69 100644
--- a/kornia/geometry/liegroup/so2.py
+++ b/kornia/geometry/liegroup/so2.py
@@ -61,12 +61,10 @@ class So2(Module):
return So2(self._z[idx])
@overload
- def __mul__(self, right: So2) -> So2:
- ...
+ def __mul__(self, right: So2) -> So2: ...
@overload
- def __mul__(self, right: Tensor) -> Tensor:
- ...
+ def __mul__(self, right: Tensor) -> Tensor: ...
def __mul__(self, right: So2 | Tensor) -> So2 | Tensor:
"""Performs a left-multiplication either rotation concatenation or point-transform.
diff --git a/kornia/geometry/ransac.py b/kornia/geometry/ransac.py
index 1e3365bcc..91eb062f6 100644
--- a/kornia/geometry/ransac.py
+++ b/kornia/geometry/ransac.py
@@ -1,4 +1,5 @@
"""Module containing RANSAC modules."""
+
import math
from functools import partial
from typing import Callable, Optional, Tuple
diff --git a/kornia/geometry/solvers/polynomial_solver.py b/kornia/geometry/solvers/polynomial_solver.py
index 1c03c027f..1bb4417af 100644
--- a/kornia/geometry/solvers/polynomial_solver.py
+++ b/kornia/geometry/solvers/polynomial_solver.py
@@ -1,4 +1,5 @@
"""Module containing the functionalities for computing the real roots of polynomial equation."""
+
import math
import torch
diff --git a/kornia/geometry/subpix/dsnt.py b/kornia/geometry/subpix/dsnt.py
index 7f9fcec5f..431abee25 100644
--- a/kornia/geometry/subpix/dsnt.py
+++ b/kornia/geometry/subpix/dsnt.py
@@ -1,7 +1,6 @@
r"""Implementation of "differentiable spatial to numerical" (soft-argmax) operations, as described in the paper
"Numerical Coordinate Regression with Convolutional Neural Networks" by Nibali et al."""
-
from __future__ import annotations
import torch
diff --git a/kornia/geometry/transform/homography_warper.py b/kornia/geometry/transform/homography_warper.py
index c925843a8..6162c96fe 100644
--- a/kornia/geometry/transform/homography_warper.py
+++ b/kornia/geometry/transform/homography_warper.py
@@ -20,12 +20,10 @@ class BaseWarper(Module):
self.width = width
@abstractmethod
- def forward(self, patch_src: Tensor, src_homo_dst: Optional[Tensor] = None) -> Tensor:
- ...
+ def forward(self, patch_src: Tensor, src_homo_dst: Optional[Tensor] = None) -> Tensor: ...
@abstractmethod
- def precompute_warp_grid(self, src_homo_dst: Tensor) -> None:
- ...
+ def precompute_warp_grid(self, src_homo_dst: Tensor) -> None: ...
class HomographyWarper(BaseWarper):
@@ -121,10 +119,10 @@ class HomographyWarper(BaseWarper):
elif _warped_grid is not None:
if not _warped_grid.device == patch_src.device:
raise TypeError(
- "Patch and warped grid must be on the same device. Got"
- " patch.device: {} warped_grid.device: {}. Whether recall"
- " precompute_warp_grid() with the correct device for the homograhy"
- " or change the patch device.".format(patch_src.device, _warped_grid.device)
+ "Patch and warped grid must be on the same device. Got"
+ f" patch.device: {patch_src.device} warped_grid.device: {_warped_grid.device}. Whether recall"
+ " precompute_warp_grid() with the correct device for the homograhy"
+ " or change the patch device."
)
warped_patch = F.grid_sample(
patch_src,
diff --git a/kornia/geometry/transform/image_registrator.py b/kornia/geometry/transform/image_registrator.py
index 2f93e57df..17f0344ea 100644
--- a/kornia/geometry/transform/image_registrator.py
+++ b/kornia/geometry/transform/image_registrator.py
@@ -16,16 +16,13 @@ __all__ = ["ImageRegistrator", "Homography", "Similarity", "BaseModel"]
class BaseModel(Module):
@abstractmethod
- def reset_model(self) -> None:
- ...
+ def reset_model(self) -> None: ...
@abstractmethod
- def forward(self) -> Tensor:
- ...
+ def forward(self) -> Tensor: ...
@abstractmethod
- def forward_inverse(self) -> Tensor:
- ...
+ def forward_inverse(self) -> Tensor: ...
class Homography(BaseModel):
diff --git a/kornia/geometry/transform/imgwarp.py b/kornia/geometry/transform/imgwarp.py
index f664cac79..20f6ceefd 100644
--- a/kornia/geometry/transform/imgwarp.py
+++ b/kornia/geometry/transform/imgwarp.py
@@ -426,16 +426,14 @@ def get_rotation_matrix2d(center: Tensor, angle: Tensor, scale: Tensor) -> Tenso
if not (center.shape[0] == angle.shape[0] == scale.shape[0]):
raise ValueError(
- "Inputs must have same batch size dimension. Got center {}, angle {} and scale {}".format(
- center.shape, angle.shape, scale.shape
- )
+ f"Inputs must have same batch size dimension. Got center {center.shape}, angle {angle.shape} and scale "
+ f"{scale.shape}"
)
if not (center.device == angle.device == scale.device) or not (center.dtype == angle.dtype == scale.dtype):
raise ValueError(
- "Inputs must have same device Got center ({}, {}), angle ({}, {}) and scale ({}, {})".format(
- center.device, center.dtype, angle.device, angle.dtype, scale.device, scale.dtype
- )
+ f"Inputs must have same device Got center ({center.device}, {center.dtype}), angle ({angle.device}, "
+ f"{angle.dtype}) and scale ({scale.device}, {scale.dtype})"
)
shift_m = eye_like(3, center)
diff --git a/kornia/testing/__init__.py b/kornia/testing/__init__.py
index 1f7e92eac..1812a063c 100644
--- a/kornia/testing/__init__.py
+++ b/kornia/testing/__init__.py
@@ -1,4 +1,5 @@
"""The testing package contains testing-specific utilities."""
+
import importlib.util
import math
import warnings
diff --git a/kornia/utils/_compat.py b/kornia/utils/_compat.py
index 981773f3c..7992358f4 100644
--- a/kornia/utils/_compat.py
+++ b/kornia/utils/_compat.py
@@ -30,8 +30,7 @@ def torch_version_ge(major: int, minor: int, patch: Optional[int] = None) -> boo
if TYPE_CHECKING:
# TODO: remove this branch when kornia relies on torch >= 1.10.0
- def torch_meshgrid(tensors: List[Tensor], indexing: Optional[str] = None) -> Tuple[Tensor, ...]:
- ...
+ def torch_meshgrid(tensors: List[Tensor], indexing: Optional[str] = None) -> Tuple[Tensor, ...]: ...
elif torch_version_ge(1, 10, 0):
diff --git a/kornia/utils/helpers.py b/kornia/utils/helpers.py
index f5d1a3be7..8d03713d6 100644
--- a/kornia/utils/helpers.py
+++ b/kornia/utils/helpers.py
@@ -66,13 +66,11 @@ def get_cuda_or_mps_device_if_available() -> torch.device:
@overload
-def map_location_to_cpu(storage: Tensor, location: str) -> Tensor:
- ...
+def map_location_to_cpu(storage: Tensor, location: str) -> Tensor: ...
@overload
-def map_location_to_cpu(storage: str) -> str:
- ...
+def map_location_to_cpu(storage: str) -> str: ...
def map_location_to_cpu(storage: Union[str, Tensor], *args: Any, **kwargs: Any) -> Union[str, Tensor]:
diff --git a/kornia/utils/image_print.py b/kornia/utils/image_print.py
index b9a40211c..09099c1b5 100644
--- a/kornia/utils/image_print.py
+++ b/kornia/utils/image_print.py
@@ -4,6 +4,7 @@ Nice long listing of all 256 colors and their codes.
Taken from https://gist.github.com/klange/1687427
"""
+
import re
from typing import Tuple, Union
diff --git a/kornia/x/trainer.py b/kornia/x/trainer.py
index 6857bd886..1be5deb72 100644
--- a/kornia/x/trainer.py
+++ b/kornia/x/trainer.py
@@ -185,8 +185,7 @@ class Trainer:
return stats.as_dict()
- def on_epoch_start(self, *args: Any, **kwargs: Any) -> None:
- ...
+ def on_epoch_start(self, *args: Any, **kwargs: Any) -> None: ...
def preprocess(self, x: Dict[str, Tensor]) -> Dict[str, Tensor]:
return x
@@ -209,11 +208,8 @@ class Trainer:
def on_model(self, model: Module, sample: Dict[str, Tensor]) -> Tensor:
return model(sample["input"])
- def on_after_model(self, output: Tensor, sample: Dict[str, Tensor]) -> None:
- ...
+ def on_after_model(self, output: Tensor, sample: Dict[str, Tensor]) -> None: ...
- def on_checkpoint(self, *args: Any, **kwargs: Dict[str, Any]) -> None:
- ...
+ def on_checkpoint(self, *args: Any, **kwargs: Dict[str, Any]) -> None: ...
- def on_epoch_end(self, *args: Any, **kwargs: Dict[str, Any]) -> None:
- ...
+ def on_epoch_end(self, *args: Any, **kwargs: Dict[str, Any]) -> None: ...
diff --git a/tests/contrib/models/test_rt_detr.py b/tests/contrib/models/test_rt_detr.py
index c0047f475..3dd2399e4 100644
--- a/tests/contrib/models/test_rt_detr.py
+++ b/tests/contrib/models/test_rt_detr.py
@@ -96,16 +96,13 @@ class TestRTDETR(BaseTester):
assert boxes.shape == (shape[0], num_queries, 4)
@pytest.mark.skip("Unnecessary")
- def test_exception(self):
- ...
+ def test_exception(self): ...
@pytest.mark.skip("Unnecessary")
- def test_gradcheck(self):
- ...
+ def test_gradcheck(self): ...
@pytest.mark.skip("Unnecessary")
- def test_module(self):
- ...
+ def test_module(self): ...
@pytest.mark.skip("Needs more investigation")
@pytest.mark.parametrize("variant", ("resnet50d", "hgnetv2_l"))
diff --git a/tests/contrib/models/test_sam.py b/tests/contrib/models/test_sam.py
index dd3b8814d..b88c4b098 100644
--- a/tests/contrib/models/test_sam.py
+++ b/tests/contrib/models/test_sam.py
@@ -71,12 +71,10 @@ class TestSam(BaseTester):
assert next(model.parameters()).device == device
@pytest.mark.skip(reason="Unsupported at moment -- the code is not tested for training and had `torch.no_grad`")
- def test_gradcheck(self, device):
- ...
+ def test_gradcheck(self, device): ...
@pytest.mark.skip(reason="Unnecessary test")
- def test_module(self):
- ...
+ def test_module(self): ...
@pytest.mark.skip(reason="Needs to be reviewed.")
def test_dynamo(self, device, torch_optimizer):
diff --git a/tests/contrib/models/test_tiny_vit.py b/tests/contrib/models/test_tiny_vit.py
index 1be183ff0..127c2c0c9 100644
--- a/tests/contrib/models/test_tiny_vit.py
+++ b/tests/contrib/models/test_tiny_vit.py
@@ -27,16 +27,13 @@ class TestTinyViT(BaseTester):
assert out.shape == (batch_size, num_classes)
@pytest.mark.skip("not implemented")
- def test_exception(self):
- ...
+ def test_exception(self): ...
@pytest.mark.skip("not implemented")
- def test_gradcheck(self):
- ...
+ def test_gradcheck(self): ...
@pytest.mark.skip("not implemented")
- def test_module(self):
- ...
+ def test_module(self): ...
def test_dynamo(self, device, dtype, torch_optimizer):
op = TinyViT().to(device=device, dtype=dtype)
diff --git a/tests/contrib/test_prompter.py b/tests/contrib/test_prompter.py
index dd0cca5ed..98febccbb 100644
--- a/tests/contrib/test_prompter.py
+++ b/tests/contrib/test_prompter.py
@@ -80,12 +80,10 @@ class TestVisualPrompter(BaseTester):
assert "The keypoints and labels should have the same batch size" in str(errinfo)
@pytest.mark.skip(reason="Unnecessary test")
- def test_gradcheck(self, device):
- ...
+ def test_gradcheck(self, device): ...
@pytest.mark.skip(reason="Unnecessary test")
- def test_module(self):
- ...
+ def test_module(self): ...
@pytest.mark.skipif(torch_version() in {"2.0.0", "2.0.1", "2.1.2"}, reason="Not working on 2.0.x and 2.1.x")
def test_dynamo(self, device, torch_optimizer):
diff --git a/tests/filters/test_filters.py b/tests/filters/test_filters.py
index 260cc1a82..1eb97bcdd 100644
--- a/tests/filters/test_filters.py
+++ b/tests/filters/test_filters.py
@@ -353,8 +353,7 @@ class TestFilter2D(BaseTester):
self.gradcheck(filter2d, (sample, kernel), nondet_tol=1e-8)
@pytest.mark.skip(reason="filter2d do not have a module")
- def test_module(self):
- ...
+ def test_module(self): ...
@pytest.mark.parametrize("normalized", [True, False])
@pytest.mark.parametrize("padding", ["same", "valid"])
@@ -711,8 +710,7 @@ class TestFilter3D(BaseTester):
self.gradcheck(filter3d, (sample, kernel), nondet_tol=1e-8)
@pytest.mark.skip(reason="filter3d do not have a module")
- def test_module(self):
- ...
+ def test_module(self): ...
@pytest.mark.parametrize("normalized", [True, False])
def test_dynamo(self, normalized, device, dtype, torch_optimizer):
diff --git a/tests/filters/test_laplacian.py b/tests/filters/test_laplacian.py
index c72645f3b..20d1fde72 100644
--- a/tests/filters/test_laplacian.py
+++ b/tests/filters/test_laplacian.py
@@ -67,8 +67,7 @@ class TestLaplacian(BaseTester):
assert actual.shape == shape
@pytest.mark.skip(reason="Nothing to test.")
- def test_exception(self):
- ...
+ def test_exception(self): ...
def test_noncontiguous(self, device, dtype):
batch_size = 3
diff --git a/tests/filters/test_motion.py b/tests/filters/test_motion.py
index 351021678..b3acba003 100644
--- a/tests/filters/test_motion.py
+++ b/tests/filters/test_motion.py
@@ -43,8 +43,7 @@ class TestMotionBlur(BaseTester):
assert motion(sample).shape == shape
@pytest.mark.skip(reason="nothing to test")
- def test_exception(self):
- ...
+ def test_exception(self): ...
@pytest.mark.parametrize("batch_size", [1, 3])
@pytest.mark.parametrize("ksize", [3, 11])
@@ -133,8 +132,7 @@ class TestMotionBlur3D(BaseTester):
assert motion(sample).shape == shape
@pytest.mark.skip(reason="nothing to test")
- def test_exception(self):
- ...
+ def test_exception(self): ...
@pytest.mark.parametrize("batch_size", [1, 3])
@pytest.mark.parametrize("ksize", [3, 11])
diff --git a/tests/filters/test_unsharp_mask.py b/tests/filters/test_unsharp_mask.py
index ea2cd4c23..462e32634 100644
--- a/tests/filters/test_unsharp_mask.py
+++ b/tests/filters/test_unsharp_mask.py
@@ -30,8 +30,7 @@ class Testunsharp(BaseTester):
assert actual.shape == shape
@pytest.mark.skip(reason="nothing to test")
- def test_exception(self):
- ...
+ def test_exception(self): ...
def test_noncontiguous(self, device, dtype):
batch_size = 3