Sadik Armagan | a097d2a | 2021-11-24 15:47:28 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <armnn/Tensor.hpp> |
| 9 | #include <armnn/utility/Assert.hpp> |
| 10 | |
| 11 | #include <cstddef> |
| 12 | #include <vector> |
| 13 | |
| 14 | template <typename T, std::size_t n> |
| 15 | struct LayerTestResult |
| 16 | { |
| 17 | LayerTestResult(const armnn::TensorInfo& outputInfo) |
| 18 | : m_Supported(true) |
| 19 | , m_CompareBoolean(false) |
| 20 | { |
| 21 | m_ActualData.reserve(outputInfo.GetNumElements()); |
| 22 | m_ExpectedData.reserve(outputInfo.GetNumElements()); |
| 23 | m_ActualShape = outputInfo.GetShape(); |
| 24 | m_ExpectedShape = outputInfo.GetShape(); |
| 25 | } |
| 26 | |
| 27 | LayerTestResult(const std::vector<T>& actualData, |
| 28 | const std::vector<T>& expectedData, |
| 29 | const armnn::TensorShape& actualShape, |
| 30 | const armnn::TensorShape& expectedShape) |
| 31 | : m_ActualData(actualData) |
| 32 | , m_ExpectedData(expectedData) |
| 33 | , m_ActualShape(actualShape) |
| 34 | , m_ExpectedShape(expectedShape) |
| 35 | , m_Supported(true) |
| 36 | , m_CompareBoolean(false) |
| 37 | {} |
| 38 | |
| 39 | LayerTestResult(const std::vector<T>& actualData, |
| 40 | const std::vector<T>& expectedData, |
| 41 | const armnn::TensorShape& actualShape, |
| 42 | const armnn::TensorShape& expectedShape, |
| 43 | const bool compareBoolean) |
| 44 | : m_ActualData(actualData) |
| 45 | , m_ExpectedData(expectedData) |
| 46 | , m_ActualShape(actualShape) |
| 47 | , m_ExpectedShape(expectedShape) |
| 48 | , m_Supported(true) |
| 49 | , m_CompareBoolean(compareBoolean) |
| 50 | {} |
| 51 | |
| 52 | std::vector<T> m_ActualData; |
| 53 | std::vector<T> m_ExpectedData; |
| 54 | armnn::TensorShape m_ActualShape; |
| 55 | armnn::TensorShape m_ExpectedShape; |
| 56 | |
| 57 | bool m_Supported; |
| 58 | bool m_CompareBoolean; |
| 59 | }; |
| 60 | |
| 61 | |
| 62 | |
| 63 | |