From c3e222568d8f873e68a87138ae4f32dfd7f035c8 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 15 Apr 2021 04:10:39 -0700 Subject: [PATCH] Fix torchvision_functional_tensor test_rgb2hsv Summary: The test is constantly failing: https://www.internalfb.com/intern/test/562949982577806?ref_report_id=0 The fix just adjusts `atol` from 1e-8 to 1e-7. The equality test was likely failing on exact zeros Reviewed By: fmassa Differential Revision: D27790959 fbshipit-source-id: ed6fa7052b4f1cacc0dcbbbfd70d3554c05d02d9 --- test/test_functional_tensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_functional_tensor.py b/test/test_functional_tensor.py index 42d44dfdbd9..73fa5583592 100644 --- a/test/test_functional_tensor.py +++ b/test/test_functional_tensor.py @@ -166,7 +166,7 @@ def test_rgb2hsv(self): self.assertLess(max_diff, 1e-5) s_hsv_img = scripted_fn(rgb_img) - self.assertTrue(hsv_img.allclose(s_hsv_img)) + self.assertTrue(hsv_img.allclose(s_hsv_img, atol=1e-7)) batch_tensors = self._create_data_batch(120, 100, num_samples=4, device=self.device).float() self._test_fn_on_batch(batch_tensors, F_t._rgb2hsv)