aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2021-06-01 09:24:52 +0100
committerSadik Armagan <sadik.armagan@arm.com>2021-06-02 13:00:56 +0000
commit483c811ea6fd0e7801aac1afd979ed02a649064b (patch)
treea0969c8786528334b62043b40983fa21d54d524e /src/armnnTfLiteParser
parent31f86bfeb311ccc0c6ed94c35a78a51551148ea4 (diff)
downloadarmnn-483c811ea6fd0e7801aac1afd979ed02a649064b.tar.gz
IVGCVSW-5962 Remove boost::multi_array
* Replaced all instances of boost::multi_array with flat vectors. * Updated LayerTestResult struct with new member variables. * Updated CompareTensor function to compare flat vectors and the shape. * Removed MakeTensor function from TensorHelpers.hpp. * Removed GetTensorShapeAsArray function from LayerTestResult.hpp. * Removed boost::array usage. * Removed boost::extents usages. * Removed boost::random usages. Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Change-Id: Iccde9d6640b534940292ff048fb80c00b38c4743
Diffstat (limited to 'src/armnnTfLiteParser')
-rw-r--r--src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
index f333ac0d40..196af190fd 100644
--- a/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
+++ b/src/armnnTfLiteParser/test/ParserFlatbuffersFixture.hpp
@@ -293,7 +293,7 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
FillInputTensors<armnnType1>(inputTensors, inputData, subgraphId);
// Allocate storage for the output tensors to be written to and setup the armnn output tensors.
- std::map<std::string, boost::multi_array<DataType2, NumOutputDimensions>> outputStorage;
+ std::map<std::string, std::vector<DataType2>> outputStorage;
armnn::OutputTensors outputTensors;
for (auto&& it : expectedOutputData)
{
@@ -309,7 +309,7 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
it.first));
armnn::VerifyTensorInfoDataType(outputTensorInfo, armnnType2);
- outputStorage.emplace(it.first, MakeTensor<DataType2, NumOutputDimensions>(outputTensorInfo));
+ outputStorage.emplace(it.first, std::vector<DataType2>(outputTensorInfo.GetNumElements()));
outputTensors.push_back(
{ outputBindingId, armnn::Tensor(outputTensorInfo, outputStorage.at(it.first).data()) });
}
@@ -320,8 +320,10 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
for (auto&& it : expectedOutputData)
{
armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first);
- auto outputExpected = MakeTensor<DataType2, NumOutputDimensions>(bindingInfo.second, it.second, isDynamic);
- auto result = CompareTensors(outputExpected, outputStorage[it.first], false, isDynamic);
+ auto outputExpected = it.second;
+ auto result = CompareTensors(outputExpected, outputStorage[it.first],
+ bindingInfo.second.GetShape(), bindingInfo.second.GetShape(),
+ false, isDynamic);
BOOST_TEST(result.m_Result, result.m_Message.str());
}
}
@@ -393,7 +395,7 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
FillInputTensors<inputType2>(inputTensors, input2Data, subgraphId);
// Allocate storage for the output tensors to be written to and setup the armnn output tensors.
- std::map<std::string, boost::multi_array<DataType2, NumOutputDimensions>> outputStorage;
+ std::map<std::string, std::vector<DataType2>> outputStorage;
armnn::OutputTensors outputTensors;
for (auto&& it : expectedOutputData)
{
@@ -409,7 +411,7 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
it.first));
armnn::VerifyTensorInfoDataType(outputTensorInfo, outputType);
- outputStorage.emplace(it.first, MakeTensor<DataType2, NumOutputDimensions>(outputTensorInfo));
+ outputStorage.emplace(it.first, std::vector<DataType2>(outputTensorInfo.GetNumElements()));
outputTensors.push_back(
{ outputBindingId, armnn::Tensor(outputTensorInfo, outputStorage.at(it.first).data()) });
}
@@ -420,8 +422,9 @@ void ParserFlatbuffersFixture::RunTest(size_t subgraphId,
for (auto&& it : expectedOutputData)
{
armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(subgraphId, it.first);
- auto outputExpected = MakeTensor<DataType2, NumOutputDimensions>(bindingInfo.second, it.second);
- auto result = CompareTensors(outputExpected, outputStorage[it.first], false);
+ auto outputExpected = it.second;
+ auto result = CompareTensors(outputExpected, outputStorage[it.first],
+ bindingInfo.second.GetShape(), bindingInfo.second.GetShape(), false);
BOOST_TEST(result.m_Result, result.m_Message.str());
}
} \ No newline at end of file