aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2021-10-05 17:31:42 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2021-10-06 15:33:20 +0000
commiteb5f810ad985a8cca831b46d94ee73db5a305c9f (patch)
tree41e85ba32c862f2cf59a39764659824c5686fbdf /src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
parentb8a26d8f497f92643288a4c519af4d230ede1d7e (diff)
downloadarmnn-eb5f810ad985a8cca831b46d94ee73db5a305c9f.tar.gz
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 <matthew.sloyan@arm.com> Change-Id: I9db03b54b6de63f918717af80c5ac5310fe26183
Diffstat (limited to 'src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp')
-rw-r--r--src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp40
1 files changed, 14 insertions, 26 deletions
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<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());
- }
+ 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<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());
- }
+ 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