MCPcopy
hub / github.com/pytorch/vision / test_kernel_image

Method test_kernel_image

test/test_transforms_v2.py:1441–1454  ·  view source on GitHub ↗
(self, param, value, dtype, device)

Source from the content-addressed store, hash-verified

1439 @pytest.mark.parametrize("dtype", [torch.float32, torch.uint8])
1440 @pytest.mark.parametrize("device", cpu_and_cuda())
1441 def test_kernel_image(self, param, value, dtype, device):
1442 if param == "fill":
1443 value = adapt_fill(value, dtype=dtype)
1444 self._check_kernel(
1445 F.affine_image,
1446 make_image(dtype=dtype, device=device),
1447 **{param: value},
1448 check_scripted_vs_eager=not (param in {"shear", "fill"} and isinstance(value, (int, float))),
1449 check_cuda_vs_cpu=(
1450 dict(atol=1, rtol=0)
1451 if dtype is torch.uint8 and param == "interpolation" and value is transforms.InterpolationMode.BILINEAR
1452 else True
1453 ),
1454 )
1455
1456 @param_value_parametrization(
1457 angle=_EXHAUSTIVE_TYPE_AFFINE_KWARGS["angle"],

Callers

nothing calls this directly

Calls 3

_check_kernelMethod · 0.95
make_imageFunction · 0.90
adapt_fillFunction · 0.85

Tested by

no test coverage detected