From ed077683e4397eeb836317760fdc83d02d712ef4 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Tue, 21 May 2019 08:18:42 +0200 Subject: [PATCH] Decreases test sensitivity --- tests/python/tensorrt/test_tensorrt_lenet5.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/python/tensorrt/test_tensorrt_lenet5.py b/tests/python/tensorrt/test_tensorrt_lenet5.py index bdc306c0b297..ce88b9de3f5c 100644 --- a/tests/python/tensorrt/test_tensorrt_lenet5.py +++ b/tests/python/tensorrt/test_tensorrt_lenet5.py @@ -95,9 +95,11 @@ def test_tensorrt_inference(): print("MXNet accuracy: %f" % mx_pct) print("MXNet-TensorRT accuracy: %f" % trt_pct) - assert abs(mx_pct - trt_pct) < 1e-2, \ - """Diff. between MXNet & TensorRT accuracy too high: - MXNet = %f, TensorRT = %f""" % (mx_pct, trt_pct) + absolute_accuracy_diff = abs(mx_pct - trt_pct) + epsilon = 1.01e-2 + assert absolute_accuracy_diff < epsilon, \ + """Absolute diff. between MXNet & TensorRT accuracy (%f) exceeds threshold (%f): + MXNet = %f, TensorRT = %f""" % (absolute_accuracy_diff, epsilon, mx_pct, trt_pct) if __name__ == '__main__':