From 9021125ff83a035dae05e5c7c0e6b1455b71af1a Mon Sep 17 00:00:00 2001 From: Bruno Goncalves Date: Sun, 11 Jul 2021 21:49:00 -0300 Subject: Fixed RunTest's TfliteParser with boolean output Tests for TfLiteParser are not working when the expected outputs have boolean type Signed-off-by: Bruno Goncalves Change-Id: I16890f82e8e581f53e6e8464668c5adf3374bf2f --- .../test/ParserFlatbuffersFixture.hpp | 33 +++++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp index b0bfdfc016..c4c75594a3 100644 --- a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp +++ b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp @@ -322,10 +322,20 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId, { armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first); auto outputExpected = it.second; - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), - false, isDynamic); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); + 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()); + } } } @@ -424,8 +434,17 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId, { armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first); auto outputExpected = it.second; - auto result = CompareTensors(outputExpected, outputStorage[it.first], - bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), false); - CHECK_MESSAGE(result.m_Result, result.m_Message.str()); + 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()); + } } } \ No newline at end of file -- cgit v1.2.1