From 6f32fdb14488d412bfb5983e4a4d80e88b2f7867 Mon Sep 17 00:00:00 2001 From: Dang Qingqing Date: Thu, 20 Sep 2018 10:03:05 +0000 Subject: [PATCH] Update unit test for random fail. --- .../paddle/fluid/contrib/tests/test_quantize_transpiler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py b/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py index a85b32d30..8800be68f 100644 --- a/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py +++ b/python/paddle/fluid/contrib/tests/test_quantize_transpiler.py @@ -234,7 +234,10 @@ class TestQuantizeTranspiler(unittest.TestCase): feed=feeder.feed(test_data), fetch_list=[loss, fv2]) self.assertAlmostEqual(test_loss1, test_loss2, delta=1e-3) - self.assertTrue(np.allclose(f_v1, f_v2, rtol=1e-05, atol=1e-05)) + self.assertTrue( + np.allclose( + f_v1, f_v2, rtol=1e-04, atol=1e-05), + "There is diff: " + str(f_v1) + "\n" + str(f_v2)) w_freeze = np.array(fluid.global_scope().find_var('conv2d_1.w_0') .get_tensor()) self.assertEqual(np.sum(w_freeze), np.sum(w_quant)) -- GitLab