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 <bruno.slackware@gmail.com>
Change-Id: I16890f82e8e581f53e6e8464668c5adf3374bf2f
diff --git a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
index b0bfdfc..c4c7559 100644
--- a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
+++ b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
@@ -322,10 +322,20 @@
{
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<DataType2, uint8_t>::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 @@
{
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<DataType2, uint8_t>::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