From 423eaa17367951e9c314ccb560db1627b912a498 Mon Sep 17 00:00:00 2001 From: xinyu-intel Date: Mon, 6 Aug 2018 09:20:53 +0800 Subject: [PATCH] change atol for int tests --- tests/python/quantization/test_quantization.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/python/quantization/test_quantization.py b/tests/python/quantization/test_quantization.py index 08303c816af1..4c3eeb7cfefc 100644 --- a/tests/python/quantization/test_quantization.py +++ b/tests/python/quantization/test_quantization.py @@ -57,7 +57,7 @@ def test_quantize_float32_to_int8(): assert same(min_val.asscalar(), -real_range) assert same(max_val.asscalar(), real_range) qdata_np = (np.sign(data_np) * np.minimum(np.abs(data_np) * scale + 0.5, quantized_range)).astype(np.int8) - assert same(qdata.asnumpy(), qdata_np) + assert_almost_equal(qdata.asnumpy(), qdata_np, atol = 1) @with_seed() @@ -77,7 +77,6 @@ def test_dequantize_int8_to_float32(): @with_seed() -@unittest.skip('Flaky test, tracked in: https://github.com/apache/incubator-mxnet/issues/11747') def test_requantize_int32_to_int8(): def quantized_int32_to_float(qdata, min_range, max_range): assert qdata.dtype == 'int32' @@ -121,7 +120,7 @@ def check_requantize(shape, min_calib_range=None, max_calib_range=None): max_range.asscalar(), min_calib_range=min_calib_range, max_calib_range=max_calib_range) - assert_almost_equal(qdata_int8.asnumpy(), qdata_int8_np) + assert_almost_equal(qdata_int8.asnumpy(), qdata_int8_np, atol = 1) assert_almost_equal(min_output.asnumpy(), np.array([min_output_np])) assert_almost_equal(max_output.asnumpy(), np.array([max_output_np]))