Beispiel #1
0
 def test_cardinality(self, device, dtype, input_shape):
     x = torch.rand(input_shape, device=device, dtype=dtype)
     assert kornia.normalize_min_max(x).shape == input_shape
Beispiel #2
0
 def test_range(self, device, dtype, min_val, max_val):
     x = torch.rand(1, 2, 4, 5, device=device, dtype=dtype)
     out = kornia.normalize_min_max(x, min_val=min_val, max_val=max_val)
     assert_allclose(out.min(), min_val)
     assert_allclose(out.max(), max_val)
Beispiel #3
0
 def test_smoke(self, device, dtype):
     x = torch.ones(1, 1, 1, 1, device=device, dtype=dtype)
     assert kornia.normalize_min_max(x) is not None
     assert kornia.enhance.normalize_min_max(x) is not None