コード例 #1
0
ファイル: test_normalize.py プロジェクト: wangguanzhi/kornia
 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
コード例 #2
0
ファイル: test_normalize.py プロジェクト: wangguanzhi/kornia
 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)
コード例 #3
0
ファイル: test_normalize.py プロジェクト: wangguanzhi/kornia
 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