diff options
author | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-01 09:24:52 +0100 |
---|---|---|
committer | Sadik Armagan <sadik.armagan@arm.com> | 2021-06-02 13:00:56 +0000 |
commit | 483c811ea6fd0e7801aac1afd979ed02a649064b (patch) | |
tree | a0969c8786528334b62043b40983fa21d54d524e /src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp | |
parent | 31f86bfeb311ccc0c6ed94c35a78a51551148ea4 (diff) | |
download | armnn-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/backends/backendsCommon/test/layerTests/LayerTestResult.hpp')
-rw-r--r-- | src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp | 68 |
1 files changed, 43 insertions, 25 deletions
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 <armnn/Tensor.hpp> #include <armnn/utility/Assert.hpp> -#include <boost/multi_array.hpp> - #include <cstddef> - -template <std::size_t n> -boost::array<unsigned int, n> GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo) -{ - ARMNN_ASSERT_MSG(n == tensorInfo.GetNumDimensions(), - "Attempting to construct a shape array of mismatching size"); - - boost::array<unsigned int, n> shape; - for (unsigned int i = 0; i < n; i++) - { - shape[i] = tensorInfo.GetShape()[i]; - } - return shape; -} +#include <vector> template <typename T, std::size_t n> struct LayerTestResult { LayerTestResult(const armnn::TensorInfo& outputInfo) + : m_Supported(true) + , m_CompareBoolean(false) { - auto shape( GetTensorShapeAsArray<n>(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<T, n> output; - boost::multi_array<T, n> outputExpected; - bool supported; - bool compareBoolean; + LayerTestResult(const std::vector<T>& actualData, + const std::vector<T>& 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<T>& actualData, + const std::vector<T>& 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<T> m_ActualData; + std::vector<T> m_ExpectedData; + armnn::TensorShape m_ActualShape; + armnn::TensorShape m_ExpectedShape; + + bool m_Supported; + bool m_CompareBoolean; }; + + + + |