Unverified Commit ce441f6b authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

remove trailing _tensor from image kernel checks (#7908)

parent a2189d6c
...@@ -459,7 +459,7 @@ class TestResize: ...@@ -459,7 +459,7 @@ class TestResize:
@pytest.mark.parametrize("antialias", [True, False]) @pytest.mark.parametrize("antialias", [True, False])
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, size, interpolation, use_max_size, antialias, dtype, device): def test_kernel_image(self, size, interpolation, use_max_size, antialias, dtype, device):
if not (max_size_kwarg := self._make_max_size_kwarg(use_max_size=use_max_size, size=size)): if not (max_size_kwarg := self._make_max_size_kwarg(use_max_size=use_max_size, size=size)):
return return
...@@ -830,7 +830,7 @@ class TestResize: ...@@ -830,7 +830,7 @@ class TestResize:
class TestHorizontalFlip: class TestHorizontalFlip:
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, dtype, device): def test_kernel_image(self, dtype, device):
check_kernel(F.horizontal_flip_image, make_image(dtype=dtype, device=device)) check_kernel(F.horizontal_flip_image, make_image(dtype=dtype, device=device))
@pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat)) @pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat))
...@@ -980,7 +980,7 @@ class TestAffine: ...@@ -980,7 +980,7 @@ class TestAffine:
) )
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, param, value, dtype, device): def test_kernel_image(self, param, value, dtype, device):
if param == "fill": if param == "fill":
value = adapt_fill(value, dtype=dtype) value = adapt_fill(value, dtype=dtype)
self._check_kernel( self._check_kernel(
...@@ -1280,7 +1280,7 @@ class TestAffine: ...@@ -1280,7 +1280,7 @@ class TestAffine:
class TestVerticalFlip: class TestVerticalFlip:
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, dtype, device): def test_kernel_image(self, dtype, device):
check_kernel(F.vertical_flip_image, make_image(dtype=dtype, device=device)) check_kernel(F.vertical_flip_image, make_image(dtype=dtype, device=device))
@pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat)) @pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat))
...@@ -1404,7 +1404,7 @@ class TestRotate: ...@@ -1404,7 +1404,7 @@ class TestRotate:
) )
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, param, value, dtype, device): def test_kernel_image(self, param, value, dtype, device):
kwargs = {param: value} kwargs = {param: value}
if param != "angle": if param != "angle":
kwargs["angle"] = self._MINIMAL_AFFINE_KWARGS["angle"] kwargs["angle"] = self._MINIMAL_AFFINE_KWARGS["angle"]
...@@ -2382,7 +2382,7 @@ class TestElastic: ...@@ -2382,7 +2382,7 @@ class TestElastic:
) )
@pytest.mark.parametrize("dtype", [torch.float32, torch.uint8]) @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
@pytest.mark.parametrize("device", cpu_and_cuda()) @pytest.mark.parametrize("device", cpu_and_cuda())
def test_kernel_image_tensor(self, param, value, dtype, device): def test_kernel_image(self, param, value, dtype, device):
image = make_image_tensor(dtype=dtype, device=device) image = make_image_tensor(dtype=dtype, device=device)
check_kernel( check_kernel(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment