From e0d37541af2e721ef7f62f9f2408e506e0f6d67a Mon Sep 17 00:00:00 2001 From: Andrey Turetskiy Date: Wed, 10 Oct 2018 15:22:40 -0700 Subject: [PATCH] [unittests] Increase allowed error threshold while comparing floating point tensors in BackendCorrectnessTest. --- tests/unittests/BackendCorrectnessTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unittests/BackendCorrectnessTest.cpp b/tests/unittests/BackendCorrectnessTest.cpp index 00741a1ce9..f07e12eddc 100644 --- a/tests/unittests/BackendCorrectnessTest.cpp +++ b/tests/unittests/BackendCorrectnessTest.cpp @@ -68,7 +68,7 @@ using CreateAndInitFunction = static bool compareAgainstInterpreter(BackendKind backendKind, CreateAndInitFunction createAndInitFunction, - bool quantize) { + bool quantize, float allowedError = 0.0001) { ExecutionEngine IEE{BackendKind::Interpreter}; ExecutionEngine BEE{backendKind}; Context ICtx, BCtx; @@ -95,7 +95,7 @@ compareAgainstInterpreter(BackendKind backendKind, IEE.run(); BEE.run(); - return IFT.second->isEqual(*BFT.second); + return IFT.second->isEqual(*BFT.second, allowedError); } } // namespace @@ -496,7 +496,7 @@ TEST_P(BackendCorrectnessTest, convOps) { TEST_P(BackendCorrectnessTest, basicFCNet) { EXPECT_TRUE(compareAgainstInterpreter(GetParam(), createAndInitBasicFCNet, - /* quantize */ false)); + /* quantize */ false, 0.0002)); } TEST_P(BackendCorrectnessTest, basicFCNetQuantized) {