From 483c811ea6fd0e7801aac1afd979ed02a649064b Mon Sep 17 00:00:00 2001 From: Sadik Armagan Date: Tue, 1 Jun 2021 09:24:52 +0100 Subject: 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 Signed-off-by: Sadik Armagan Change-Id: Iccde9d6640b534940292ff048fb80c00b38c4743 --- .../test/layerTests/LayerTestResult.hpp | 68 ++++++++++++++-------- 1 file changed, 43 insertions(+), 25 deletions(-) (limited to 'src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp') diff --git a/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp b/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp index c64fc88024..ac60764964 100644 --- a/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp +++ b/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp @@ -8,38 +8,56 @@ #include #include -#include - #include - -template -boost::array GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo) -{ - ARMNN_ASSERT_MSG(n == tensorInfo.GetNumDimensions(), - "Attempting to construct a shape array of mismatching size"); - - boost::array shape; - for (unsigned int i = 0; i < n; i++) - { - shape[i] = tensorInfo.GetShape()[i]; - } - return shape; -} +#include template struct LayerTestResult { LayerTestResult(const armnn::TensorInfo& outputInfo) + : m_Supported(true) + , m_CompareBoolean(false) { - auto shape( GetTensorShapeAsArray(outputInfo) ); - output.resize(shape); - outputExpected.resize(shape); - supported = true; - compareBoolean = false; + m_ActualData.reserve(outputInfo.GetNumElements()); + m_ExpectedData.reserve(outputInfo.GetNumElements()); + m_ActualShape = outputInfo.GetShape(); + m_ExpectedShape = outputInfo.GetShape(); } - boost::multi_array output; - boost::multi_array outputExpected; - bool supported; - bool compareBoolean; + LayerTestResult(const std::vector& actualData, + const std::vector& expectedData, + const armnn::TensorShape& actualShape, + const armnn::TensorShape& expectedShape) + : m_ActualData(actualData) + , m_ExpectedData(expectedData) + , m_ActualShape(actualShape) + , m_ExpectedShape(expectedShape) + , m_Supported(true) + , m_CompareBoolean(false) + {} + + LayerTestResult(const std::vector& actualData, + const std::vector& expectedData, + const armnn::TensorShape& actualShape, + const armnn::TensorShape& expectedShape, + const bool compareBoolean) + : m_ActualData(actualData) + , m_ExpectedData(expectedData) + , m_ActualShape(actualShape) + , m_ExpectedShape(expectedShape) + , m_Supported(true) + , m_CompareBoolean(compareBoolean) + {} + + std::vector m_ActualData; + std::vector m_ExpectedData; + armnn::TensorShape m_ActualShape; + armnn::TensorShape m_ExpectedShape; + + bool m_Supported; + bool m_CompareBoolean; }; + + + + -- cgit v1.2.1