π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Gradcheck
Paua3846a0e46a1
diff --git a/test/color/test_hls.py b/test/color/test_hls.pyindex da3fa6f98..bbc89cb4c 100644--- a/test/color/test_hls.py+++ b/test/color/test_hls.py@@ -62,14 +62,7 @@ class TestRgbToHls:def test_gradcheck(self):- data = torch.tensor([[[[21., 22.],- [22., 22.]],-- [[13., 14.],- [14., 14.]],-- [[8., 8.],- [8., 8.]]]]) # 3x2x2+ data = torch.rand(3,5,5) # 3x2x2data = utils.tensor_to_gradcheck_var(data) # to var@@ -146,12 +139,22 @@ class TestHlsToRgb:assert_allclose(f(data), expected)- data[:, 0] += 2*pi+ data[:, 0] += 2 * piassert_allclose(f(data), expected)- data[:, 0] -= 4*pi+ data[:, 0] -= 4 * piassert_allclose(f(data), expected)+ def test_gradcheck(self):++ data = torch.rand(3,5,5) # 3x2x2+ data[0] = 2 * pi * data[0]++ data = utils.tensor_to_gradcheck_var(data) # to var++ assert gradcheck(kornia.color.HlsToRgb(), (data,),+ raise_exception=True)+@pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.scriptdiff --git a/test/color/test_hsv.py b/test/color/test_hsv.pyindex 17192ce54..a2c834c49 100644--- a/test/color/test_hsv.py+++ b/test/color/test_hsv.py@@ -63,14 +63,7 @@ class TestRgbToHsv:def test_gradcheck(self):- data = torch.tensor([[[[21., 22.],- [22., 22.]],-- [[13., 14.],- [14., 14.]],-- [[8., 8.],- [8., 8.]]]]) # 3x2x2+ data = torch.rand(3,5,5) # 3x2x2data = utils.tensor_to_gradcheck_var(data) # to var@@ -147,12 +140,22 @@ class TestHsvToRgb:assert_allclose(f(data), expected)- data[:, 0] += 2*pi+ data[:, 0] += 2 * piassert_allclose(f(data), expected)- data[:, 0] -= 4*pi+ data[:, 0] -= 4 * piassert_allclose(f(data), expected)+ def test_gradcheck(self):++ data = torch.rand(3,5,5) # 3x2x2+ data[0] = 2 * pi * data[0]++ data = utils.tensor_to_gradcheck_var(data) # to var++ assert gradcheck(kornia.color.HsvToRgb(), (data,),+ raise_exception=True)+@pytest.mark.skip(reason="turn off all jit for a while")def test_jit(self):@torch.jit.script