π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
add test_jit in TestTransformPoints
edgarribaa6312bd2bbca
diff --git a/test/geometry/test_linalg.py b/test/geometry/test_linalg.pyindex 7f95b7742..77dd9208c 100644--- a/test/geometry/test_linalg.py+++ b/test/geometry/test_linalg.py@@ -6,6 +6,7 @@ from test.common import TEST_DEVICESimport torchfrom torch.autograd import gradcheck+from torch.testing import assert_allclosedef identity_matrix(batch_size):@@ -66,8 +67,7 @@ class TestTransformPoints:points_dst_to_src = kornia.transform_points(src_homo_dst, points_dst)# projected should be equal as initial- error = utils.compute_mse(points_src, points_dst_to_src)- assert pytest.approx(error.item(), 0.0)+ assert_allclose(points_src, points_dst_to_src)def test_gradcheck(self):# generate input data@@ -81,6 +81,18 @@ class TestTransformPoints:assert gradcheck(kornia.transform_points, (dst_homo_src, points_src,),raise_exception=True)+ def test_jit(self):+ @torch.jit.script+ def op_script(transform, points):+ return kornia.transform_points(transform, points)++ points = torch.ones(1, 2, 2)+ transform = torch.eye(3)[None]+ actual = op_script(transform, points)+ expected = kornia.transform_points(transform, points)++ assert_allclose(actual, expected)+class TestComposeTransforms: