From 59cfafbb9e4d5c31856a78a1e71514725bca3df9 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Mon, 11 Mar 2019 16:28:30 -0700 Subject: [PATCH] Restore tolerance fix and make test_gru_seq_length_cpu run (#595) --- onnxruntime/test/python/onnx_backend_test_series.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/onnxruntime/test/python/onnx_backend_test_series.py b/onnxruntime/test/python/onnx_backend_test_series.py index 588f717214..2d00bc72f3 100644 --- a/onnxruntime/test/python/onnx_backend_test_series.py +++ b/onnxruntime/test/python/onnx_backend_test_series.py @@ -11,10 +11,10 @@ import onnxruntime.backend as c2 pytest_plugins = 'onnx.backend.test.report', -class OnnxruntimeBackendTest(onnx.backend.test.BackendTest): +class OrtBackendTest(onnx.backend.test.BackendTest): def __init__(self, backend, parent_module=None): - onnx.backend.test.BackendTest.__init__(self, backend, parent_module) + super(OrtBackendTest, self).__init__(backend, parent_module) @classmethod def assert_similar_outputs(cls, ref_outputs, outputs, rtol, atol): @@ -27,18 +27,16 @@ class OnnxruntimeBackendTest(onnx.backend.test.BackendTest): np.testing.assert_allclose( ref_outputs[i], outputs[i], - rtol=rtol, - atol=atol) + rtol=1e-3, + atol=1e-5) - -backend_test = OnnxruntimeBackendTest(c2, __name__) +backend_test = OrtBackendTest(c2, __name__) # Type not supported backend_test.exclude(r'(FLOAT16)') backend_test.exclude(r'(' '^test_cast_DOUBLE_to_FLOAT_cpu.*' -'|^test_gru_seq_length_cpu.*' '|^test_cast_FLOAT_to_DOUBLE_cpu.*' '|^test_cast_FLOAT_to_STRING_cpu.*' '|^test_cast_STRING_to_FLOAT_cpu.*'