From eb5f810ad985a8cca831b46d94ee73db5a305c9f Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Tue, 5 Oct 2021 17:31:42 +0100 Subject: IVGCVSW-6165 Add Support for Conv3d to TfLiteParser * Added CONV_3D operator support. * Fixed TfLiteParser test issue where QAsymmU8 tests were incorrectly using the Boolean comparison function. Signed-off-by: Matthew Sloyan Change-Id: I9db03b54b6de63f918717af80c5ac5310fe26183 --- .../test/ParserFlatbuffersFixture.hpp | 40 ++++++++-------------- 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp') diff --git a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp index b4653cd8db..a237d2fc14 100644 --- a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp +++ b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp @@ -376,25 +376,18 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId, m_Runtime->EnqueueWorkload(m_NetworkIdentifier, inputTensors, outputTensors); + // Set flag so that the correct comparison function is called if the output is boolean. + bool isBoolean = armnnType2 == armnn::DataType::Boolean ? true : false; + // Compare each output tensor to the expected values for (auto&& it : expectedOutputData) { armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first); auto outputExpected = it.second; - if (std::is_same::value) - { - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), - true, isDynamic); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); - } - else - { - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), - false, isDynamic); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); - } + auto result = CompareTensors(outputExpected, outputStorage[it.first], + bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), + isBoolean, isDynamic); + CHECK_MESSAGE(result.m_Result, result.m_Message.str()); } if (isDynamic) @@ -504,22 +497,17 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId, m_Runtime->EnqueueWorkload(m_NetworkIdentifier, inputTensors, outputTensors); + // Set flag so that the correct comparison function is called if the output is boolean. + bool isBoolean = outputType == armnn::DataType::Boolean ? true : false; + // Compare each output tensor to the expected values for (auto&& it : expectedOutputData) { armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first); auto outputExpected = it.second; - if (std::is_same::value) - { - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), true); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); - } - else - { - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape()); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); - } + auto result = CompareTensors(outputExpected, outputStorage[it.first], + bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), + isBoolean); + CHECK_MESSAGE(result.m_Result, result.m_Message.str()); } } \ No newline at end of file -- cgit v1.2.1