Create derived class from onnx BackendTest so we can use the same tolerance values as in onnx_test_runner. Enable GRU test that was failing. (#584)

This commit is contained in:
Scott McKay 2019-03-08 14:51:13 -08:00 committed by GitHub
parent b742c3a965
commit fb6f091073
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,12 +10,22 @@ import onnxruntime.backend as c2
pytest_plugins = 'onnx.backend.test.report',
backend_test = onnx.backend.test.BackendTest(c2, __name__)
class OrtBackendTest(onnx.backend.test.BackendTest):
def __init__(self, backend, parent_module=None):
super(OrtBackendTest, self).__init__(backend, parent_module)
@classmethod
def assert_similar_outputs(cls, ref_outputs, outputs, rtol, atol):
# type: (Sequence[Any], Sequence[Any], float, float) -> None
# override the rtol and atol values to match onnx_test_runner tolerances
super(OrtBackendTest, cls).assert_similar_outputs(ref_outputs, outputs, 1e-3, 1e-5)
backend_test = OrtBackendTest(c2, __name__)
# Type not supported
backend_test.exclude(r'(FLOAT16)')
backend_test.exclude(r'^test_gru_seq_length_cpu.*')
backend_test.exclude(r'('
'^test_cast_DOUBLE_to_FLOAT_cpu.*'