예제 #1
0
파일: test_luv.py 프로젝트: zeta1999/kornia
 def test_gradcheck(self, device, dtype):
     B, C, H, W = 2, 3, 4, 4
     img = torch.rand(B,
                      C,
                      H,
                      W,
                      device=device,
                      dtype=torch.float64,
                      requires_grad=True)
     img = kornia.rgb_to_luv(img)
     assert gradcheck(kornia.color.luv_to_rgb, (img, ),
                      raise_exception=True)
예제 #2
0
파일: test_luv.py 프로젝트: zyweven/kornia
    def test_grad(self, device):

        data = kornia.rgb_to_luv(torch.rand(2, 3, 4, 5).to(device))
        data = utils.tensor_to_gradcheck_var(data)
        assert gradcheck(kornia.color.LuvToRgb(), (data, ),
                         raise_exception=True)