π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
[Feat] Improv conftest fixtures and remove device, dtype imports (#568)
Edgar Riba916a90e5acf6
diff --git a/Makefile b/Makefileindex 76e1937e1..7a21ad601 100644--- a/Makefile+++ b/Makefile@@ -3,13 +3,13 @@test: mypy lint build-docs test-alltest-all: FORCE- pytest -v --device cpu,cuda --dtype float16,float32,float64 --cov=kornia test/ --flake8 --mypy+ pytest -v --device all --dtype all --cov=kornia test/ --flake8 --mypytest-cpu: FORCE- pytest -v --device cpu --dtype float32,float64 --cov=kornia test/ --flake8 --mypy+ pytest -v --device cpu --dtype all --cov=kornia test/ --flake8 --mypytest-cuda: FORCE- pytest -v --device cuda --dtype float16,float32,float64 --cov=kornia test/ --flake8 --mypy+ pytest -v --device cuda --dtype all --cov=kornia test/ --flake8 --mypylint: FORCEpytest -v --flake8 -m flake8diff --git a/conftest.py b/conftest.pyindex 77b844a8e..fbb7b5050 100644--- a/conftest.py+++ b/conftest.py@@ -1,13 +1,82 @@+from itertools import product+from typing import Dict+import pytest+import torch+++def get_test_devices() -> Dict[str, torch.device]:+ """Creates a dictionary with the devices to test the source code.+ CUDA devices will be test only in case the current hardware supports it.++ Return:+ dict(str, torch.device): list with devices names.+ """+ devices: Dict[str, torch.device] = {}+ devices["cpu"] = torch.device("cpu")+ if torch.cuda.is_available():+ devices["cuda"] = torch.device("cuda:0")+ return devices+++def get_test_dtypes() -> Dict[str, torch.dtype]:+ """Creates a dictionary with the dtypes the source code.++ Return:+ dict(str, torch.dtype): list with dtype names.+ """+ dtypes: Dict[str, torch.dtype] = {}+ dtypes["float16"] = torch.float16+ dtypes["float32"] = torch.float32+ dtypes["float64"] = torch.float64+ return dtypes+++# setup the devices to test the source code++TEST_DEVICES: Dict[str, torch.device] = get_test_devices()+TEST_DTYPES: Dict[str, torch.dtype] = get_test_dtypes()++# Combinations of device and dtype to be excluded from testing.+DEVICE_DTYPE_BLACKLIST = {('cpu', 'float16')}+++def device(device_name) -> torch.device:+ if device_name not in TEST_DEVICES:+ pytest.skip(f"Unsupported device type: {device_name}")+ return TEST_DEVICES[device_name]+++def dtype(dtype_name) -> torch.dtype:+ return TEST_DTYPES[dtype_name]def pytest_generate_tests(metafunc):+ device_names = None+ dtype_names = Noneif 'device_name' in metafunc.fixturenames:raw_value = metafunc.config.getoption('--device')- metafunc.parametrize('device_name', raw_value.split(','))+ if raw_value == 'all':+ device_names = list(TEST_DEVICES.keys())+ else:+ device_names = raw_value.split(',')if 'dtype_name' in metafunc.fixturenames:raw_value = metafunc.config.getoption('--dtype')- metafunc.parametrize('dtype_name', raw_value.split(','))+ if raw_value == 'all':+ dtype_names = list(TEST_DTYPES.keys())+ else:+ dtype_names = raw_value.split(',')+ if device_names is not None and dtype_names is not None:+ # Exclude any blacklisted device/dtype combinations.+ params = [combo for combo in product(device_names, dtype_names)+ if combo not in DEVICE_DTYPE_BLACKLIST]+ metafunc.parametrize('device_name,dtype_name', params)+ elif device_names is not None:+ metafunc.parametrize('device_name', device_names)+ elif dtype_names is not None:+ metafunc.parametrize('dtype_name', dtype_names)def pytest_addoption(parser):diff --git a/test/augmentation/test_augmentation.py b/test/augmentation/test_augmentation.pyindex 0c90e4668..dfc730884 100644--- a/test/augmentation/test_augmentation.py+++ b/test/augmentation/test_augmentation.py@@ -13,8 +13,6 @@ from kornia.constants import pifrom kornia.augmentation import RandomHorizontalFlip, RandomVerticalFlip, ColorJitter, \RandomErasing, RandomGrayscale, RandomRotation, RandomCrop, RandomResizedCrop, RandomMotionBlur-from test.common import device-class TestRandomHorizontalFlip:diff --git a/test/augmentation/test_functional.py b/test/augmentation/test_functional.pyindex 8a4db3c5c..f973fb359 100644--- a/test/augmentation/test_functional.py+++ b/test/augmentation/test_functional.py@@ -11,8 +11,6 @@ import kornia.augmentation.functional as Ffrom kornia.constants import pifrom kornia.augmentation import ColorJitter-from test.common import device-class TestHorizontalFlipFn:diff --git a/test/augmentation/test_perspective.py b/test/augmentation/test_perspective.pyindex 4e39b84f0..57c83018d 100644--- a/test/augmentation/test_perspective.py+++ b/test/augmentation/test_perspective.py@@ -7,7 +7,6 @@ from torch.autograd import gradcheckimport korniaimport kornia.augmentation.functional as Fimport kornia.testing as utils # test utils-from test.common import deviceclass TestPerspective:diff --git a/test/augmentation/test_transformation_matrix.py b/test/augmentation/test_transformation_matrix.pyindex f2d7f60f4..6cd98714f 100644--- a/test/augmentation/test_transformation_matrix.py+++ b/test/augmentation/test_transformation_matrix.py@@ -11,8 +11,6 @@ import kornia.augmentation.functional as Ffrom kornia.constants import pifrom kornia.augmentation import ColorJitter-from test.common import device-class TestHorizontalFlipFn:diff --git a/test/color/test_adjust.py b/test/color/test_adjust.pyindex c4cdba843..40472f7e5 100644--- a/test/color/test_adjust.py+++ b/test/color/test_adjust.py@@ -3,7 +3,6 @@ import pytestimport korniaimport kornia.testing as utils # test utilsfrom kornia.constants import pi-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_core.py b/test/color/test_core.pyindex 33d626b96..595013a3d 100644--- a/test/color/test_core.py+++ b/test/color/test_core.py@@ -3,7 +3,6 @@ import randomimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_gray.py b/test/color/test_gray.pyindex 6bb1d6be2..b0d679a4a 100644--- a/test/color/test_gray.py+++ b/test/color/test_gray.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import device, dtypeimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_histogram.py b/test/color/test_histogram.pyindex b2e1d49a1..57317a92b 100644--- a/test/color/test_histogram.py+++ b/test/color/test_histogram.py@@ -1,5 +1,4 @@import pytest-from test.common import deviceimport numpy as npimport torchfrom torch.testing import assert_allclosediff --git a/test/color/test_hls.py b/test/color/test_hls.pyindex 28b0f75cc..3f6da2617 100644--- a/test/color/test_hls.py+++ b/test/color/test_hls.py@@ -3,7 +3,6 @@ import pytestimport korniaimport kornia.testing as utils # test utilsfrom kornia.constants import pi-from test.common import deviceimport mathdiff --git a/test/color/test_hsv.py b/test/color/test_hsv.pyindex 24749f37b..b74ad44a6 100644--- a/test/color/test_hsv.py+++ b/test/color/test_hsv.py@@ -3,7 +3,6 @@ import pytestimport korniafrom kornia.constants import piimport kornia.testing as utils # test utils-from test.common import deviceimport mathdiff --git a/test/color/test_luv.py b/test/color/test_luv.pyindex a8a764652..bbf467c8c 100644--- a/test/color/test_luv.py+++ b/test/color/test_luv.py@@ -6,7 +6,6 @@ import kornia.testing as utils # test utilsimport torchfrom torch.autograd import gradcheckfrom torch.testing import assert_allclose-from test.common import deviceclass TestRgbToLuv:diff --git a/test/color/test_normalize.py b/test/color/test_normalize.pyindex 83bfa0829..fb1a2bf0e 100644--- a/test/color/test_normalize.py+++ b/test/color/test_normalize.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_rgb.py b/test/color/test_rgb.pyindex 79427e377..2befb3957 100644--- a/test/color/test_rgb.py+++ b/test/color/test_rgb.py@@ -1,6 +1,5 @@import korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_xyz.py b/test/color/test_xyz.pyindex 583644d29..f1d6ff8fb 100644--- a/test/color/test_xyz.py+++ b/test/color/test_xyz.py@@ -6,7 +6,6 @@ import kornia.testing as utils # test utilsimport torchfrom torch.autograd import gradcheckfrom torch.testing import assert_allclose-from test.common import deviceclass TestRgbToXyz:diff --git a/test/color/test_yuv.py b/test/color/test_yuv.pyindex 291872207..503be6d4d 100644--- a/test/color/test_yuv.py+++ b/test/color/test_yuv.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/color/test_zca.py b/test/color/test_zca.pyindex 12745a9fe..52ea6f413 100644--- a/test/color/test_zca.py+++ b/test/color/test_zca.py@@ -8,7 +8,6 @@ import kornia.testing as utils # test utilsimport torchfrom torch.autograd import gradcheckfrom torch.testing import assert_allclose-from test.common import device, dtypeclass TestZCA:diff --git a/test/common.py b/test/common.pydeleted file mode 100644index 17c72ff2a..000000000--- a/test/common.py+++ /dev/null@@ -1,51 +0,0 @@-from typing import Dict--import torch-import pytest---def get_test_devices() -> Dict[str, torch.device]:- """Creates a dictionary with the devices to test the source code.- CUDA devices will be test only in case the current hardware supports it.-- Return:- dict(str, torch.device): list with devices names.- """- devices: Dict[str, torch.device] = {}- devices["cpu"] = torch.device("cpu")- if torch.cuda.is_available():- devices["cuda"] = torch.device("cuda:0")- return devices---def get_test_dtypes() -> Dict[str, torch.dtype]:- """Creates a dictionary with the dtypes the source code.-- Return:- dict(str, torch.dtype): list with dtype names.- """- dtypes: Dict[str, torch.dtype] = {}- dtypes["float16"] = torch.float16- dtypes["float32"] = torch.float32- dtypes["float64"] = torch.float64- return dtypes---# setup the devices to test the source code--TEST_DEVICES: Dict[str, torch.device] = get_test_devices()-TEST_DTYPES: Dict[str, torch.dtype] = get_test_dtypes()---def device(device_name) -> torch.device:- if device_name not in TEST_DEVICES:- pytest.skip(f"Unsupported device type: {device_name}")- return TEST_DEVICES[device_name]---def dtype(device, dtype_name) -> torch.dtype:- if device.type == 'cpu' and dtype_name == 'float16':- pytest.skip(f"Unsupported device cpu and dtype float16.")- return TEST_DTYPES[dtype_name]diff --git a/test/feature/test_affine_shape_estimator.py b/test/feature/test_affine_shape_estimator.pyindex acb32cb0f..f5f01d7e5 100644--- a/test/feature/test_affine_shape_estimator.py+++ b/test/feature/test_affine_shape_estimator.py@@ -1,7 +1,6 @@import pytestimport kornia.testing as utils # test utilsimport kornia-from test.common import devicefrom torch.testing import assert_allclosefrom torch.autograd import gradcheckdiff --git a/test/feature/test_hardnet.py b/test/feature/test_hardnet.pyindex f89e4d138..61dadfb85 100644--- a/test/feature/test_hardnet.py+++ b/test/feature/test_hardnet.py@@ -1,5 +1,4 @@import pytest-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/feature/test_laf.py b/test/feature/test_laf.pyindex 2939dacbe..d7f7b26cc 100644--- a/test/feature/test_laf.py+++ b/test/feature/test_laf.py@@ -3,7 +3,6 @@ import pytestimport kornia as korniaimport kornia.geometry.transform.imgwarpimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/feature/test_local_features_orientation.py b/test/feature/test_local_features_orientation.pyindex 9468988d1..738fa656e 100644--- a/test/feature/test_local_features_orientation.py+++ b/test/feature/test_local_features_orientation.py@@ -1,7 +1,6 @@import pytestimport kornia.testing as utils # test utilsimport kornia-from test.common import devicefrom torch.testing import assert_allclosefrom torch.autograd import gradcheckdiff --git a/test/feature/test_nms.py b/test/feature/test_nms.pyindex 2bf2b1a9d..a2fe76fa0 100644--- a/test/feature/test_nms.py+++ b/test/feature/test_nms.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/feature/test_responces_local_features.py b/test/feature/test_responces_local_features.pyindex ea6825097..159be72d7 100644--- a/test/feature/test_responces_local_features.py+++ b/test/feature/test_responces_local_features.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/feature/test_scale_space_detector.py b/test/feature/test_scale_space_detector.pyindex 2d384c5a5..870f19cee 100644--- a/test/feature/test_scale_space_detector.py+++ b/test/feature/test_scale_space_detector.py@@ -2,7 +2,6 @@ import pytestimport torchimport kornia.testing as utils # test utilsimport kornia-from test.common import devicefrom torch.testing import assert_allclosefrom torch.autograd import gradcheckdiff --git a/test/feature/test_siftdesc.py b/test/feature/test_siftdesc.pyindex 3456773d0..07f2cb436 100644--- a/test/feature/test_siftdesc.py+++ b/test/feature/test_siftdesc.py@@ -1,6 +1,5 @@import pytestimport kornia.testing as utils # test utils-from test.common import devicefrom torch.testing import assert_allclosefrom torch.autograd import gradcheckdiff --git a/test/feature/test_sosnet.py b/test/feature/test_sosnet.pyindex 18a162ebb..dc769df01 100644--- a/test/feature/test_sosnet.py+++ b/test/feature/test_sosnet.py@@ -1,5 +1,4 @@import pytest-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/filters/test_blur.py b/test/filters/test_blur.pyindex ed7a9cfeb..b9c837b74 100644--- a/test/filters/test_blur.py+++ b/test/filters/test_blur.py@@ -4,7 +4,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/filters/test_filters.py b/test/filters/test_filters.pyindex 67787bbf0..01202763c 100644--- a/test/filters/test_filters.py+++ b/test/filters/test_filters.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/filters/test_gaussian.py b/test/filters/test_gaussian.pyindex c52574700..67014a94a 100644--- a/test/filters/test_gaussian.py+++ b/test/filters/test_gaussian.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/filters/test_median.py b/test/filters/test_median.pyindex c3e590b80..35b259cf7 100644--- a/test/filters/test_median.py+++ b/test/filters/test_median.py@@ -4,7 +4,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/filters/test_motion.py b/test/filters/test_motion.pyindex 18a0235aa..5d5068d43 100644--- a/test/filters/test_motion.py+++ b/test/filters/test_motion.py@@ -3,7 +3,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/filters/test_sobel.py b/test/filters/test_sobel.pyindex 8044f2641..91c39d494 100644--- a/test/filters/test_sobel.py+++ b/test/filters/test_sobel.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/geometry/test_conversions.py b/test/geometry/test_conversions.pyindex c23d893b8..05edbca79 100644--- a/test/geometry/test_conversions.py+++ b/test/geometry/test_conversions.py@@ -5,7 +5,6 @@ import numpy as npimport korniafrom kornia.testing import tensor_to_gradcheck_var, create_eye_batch-from test.common import device, dtypeimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/test_depth.py b/test/geometry/test_depth.pyindex a6fd0ce8c..a3b6c2bf3 100644--- a/test/geometry/test_depth.py+++ b/test/geometry/test_depth.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/test_dsnt.py b/test/geometry/test_dsnt.pyindex 2c73f5f14..1750bccbc 100644--- a/test/geometry/test_dsnt.py+++ b/test/geometry/test_dsnt.py@@ -1,7 +1,6 @@import pytestimport kornia as kornia-from test.common import dtype, deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/geometry/test_linalg.py b/test/geometry/test_linalg.pyindex 353b57e12..af9c97ce8 100644--- a/test/geometry/test_linalg.py+++ b/test/geometry/test_linalg.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/test_perspective.py b/test/geometry/test_perspective.pyindex cb1b86324..0621d5d55 100644--- a/test/geometry/test_perspective.py+++ b/test/geometry/test_perspective.py@@ -2,7 +2,6 @@ import pytestimport korniafrom kornia.testing import tensor_to_gradcheck_var-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/test_pinhole.py b/test/geometry/test_pinhole.pyindex a7e8d8b0b..eb7448e3d 100644--- a/test/geometry/test_pinhole.py+++ b/test/geometry/test_pinhole.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/test_spatial_softargmax.py b/test/geometry/test_spatial_softargmax.pyindex d0d99623d..9bc20d13a 100644--- a/test/geometry/test_spatial_softargmax.py+++ b/test/geometry/test_spatial_softargmax.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import device, dtypeimport torchfrom torch.nn.functional import mse_lossdiff --git a/test/geometry/transform/test_affine.py b/test/geometry/transform/test_affine.pyindex eea458238..61a51b33d 100644--- a/test/geometry/transform/test_affine.py+++ b/test/geometry/transform/test_affine.py@@ -1,7 +1,6 @@import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/transform/test_crop.py b/test/geometry/transform/test_crop.pyindex 396cb18f0..37db96693 100644--- a/test/geometry/transform/test_crop.py+++ b/test/geometry/transform/test_crop.py@@ -4,7 +4,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/geometry/transform/test_flip.py b/test/geometry/transform/test_flip.pyindex dffeb7f1b..8fd846022 100644--- a/test/geometry/transform/test_flip.py+++ b/test/geometry/transform/test_flip.py@@ -3,7 +3,6 @@ import torchimport pytestimport kornia.testing as utils # test utils-from test.common import devicefrom torch.testing import assert_allclosefrom torch.autograd import gradcheckdiff --git a/test/geometry/transform/test_imgwarp.py b/test/geometry/transform/test_imgwarp.pyindex bf75447ee..493addc18 100644--- a/test/geometry/transform/test_imgwarp.py+++ b/test/geometry/transform/test_imgwarp.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/transform/test_pyramid.py b/test/geometry/transform/test_pyramid.pyindex 1ae41f840..c35c475d0 100644--- a/test/geometry/transform/test_pyramid.py+++ b/test/geometry/transform/test_pyramid.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.testing import assert_allclosediff --git a/test/geometry/warp/test_depth_warper.py b/test/geometry/warp/test_depth_warper.pyindex 723f511f8..ec98905e9 100644--- a/test/geometry/warp/test_depth_warper.py+++ b/test/geometry/warp/test_depth_warper.py@@ -3,7 +3,6 @@ import pytestimport korniaimport kornia.testing as utils # test utilsfrom kornia.geometry.conversions import normalize_pixel_coordinates-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/geometry/warp/test_homography_warper.py b/test/geometry/warp/test_homography_warper.pyindex 98b544401..906d49fca 100644--- a/test/geometry/warp/test_homography_warper.py+++ b/test/geometry/warp/test_homography_warper.py@@ -2,7 +2,6 @@ import pytestimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import deviceimport torchfrom torch.autograd import gradcheckdiff --git a/test/integration/test_focal.py b/test/integration/test_focal.pyindex 897ff7e42..a8e7783ae 100644--- a/test/integration/test_focal.py+++ b/test/integration/test_focal.py@@ -5,7 +5,6 @@ import torchimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as optim-from test.common import deviceimport korniadiff --git a/test/integration/test_soft_argmax2d.py b/test/integration/test_soft_argmax2d.pyindex 5ef4998a2..71f844498 100644--- a/test/integration/test_soft_argmax2d.py+++ b/test/integration/test_soft_argmax2d.py@@ -1,6 +1,5 @@import loggingimport pytest-from test.common import deviceimport torchimport torch.nn as nndiff --git a/test/integration/test_warp.py b/test/integration/test_warp.pyindex 40bfcc46e..08a4b0fca 100644--- a/test/integration/test_warp.py+++ b/test/integration/test_warp.py@@ -7,7 +7,6 @@ import torchimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim as optim-from test.common import deviceclass MyHomography(nn.Module):diff --git a/test/performance/test_imgwarp_speed.py b/test/performance/test_imgwarp_speed.pyindex ae1e9570e..c3cde6fd4 100644--- a/test/performance/test_imgwarp_speed.py+++ b/test/performance/test_imgwarp_speed.py@@ -4,8 +4,6 @@ from time import timeimport torchimport kornia as kornia-from test.common import device, dtype-shapes = [(512, 3, 256, 256), (256, 1, 64, 64)]PSs = [224, 32]diff --git a/test/test_contrib.py b/test/test_contrib.pyindex f82cf4c4a..204b11393 100644--- a/test/test_contrib.py+++ b/test/test_contrib.py@@ -3,7 +3,6 @@ import pytestimport torchfrom torch.autograd import gradcheckfrom torch.testing import assert_allclose-from test.common import deviceimport korniaimport kornia.testing as utils # test utilsdiff --git a/test/test_losses.py b/test/test_losses.pyindex 128f1704c..a56384dff 100644--- a/test/test_losses.py+++ b/test/test_losses.py@@ -2,7 +2,6 @@ import pytestimport korniaimport kornia.testing as utils # test utils-from test.common import device, dtypeimport mathimport torchdiff --git a/test/utils/test_image.py b/test/utils/test_image.pyindex c5b919012..57a3ebe65 100644--- a/test/utils/test_image.py+++ b/test/utils/test_image.py@@ -4,7 +4,6 @@ import numpy as npimport torchimport kornia as korniaimport kornia.testing as utils # test utils-from test.common import device@pytest.mark.parametrize("input_dtype, expected_dtype",