Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #pragma once |
| 7 | |
| 8 | #include <armnn/Tensor.hpp> |
Narumol Prangnawarat | ac2770a | 2020-04-01 16:51:23 +0100 | [diff] [blame] | 9 | #include <armnn/utility/Assert.hpp> |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 10 | |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 11 | #include <cstddef> |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 12 | #include <vector> |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 13 | |
| 14 | template <typename T, std::size_t n> |
| 15 | struct LayerTestResult |
| 16 | { |
| 17 | LayerTestResult(const armnn::TensorInfo& outputInfo) |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 18 | : m_Supported(true) |
| 19 | , m_CompareBoolean(false) |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 20 | { |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 21 | m_ActualData.reserve(outputInfo.GetNumElements()); |
| 22 | m_ExpectedData.reserve(outputInfo.GetNumElements()); |
| 23 | m_ActualShape = outputInfo.GetShape(); |
| 24 | m_ExpectedShape = outputInfo.GetShape(); |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 25 | } |
| 26 | |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 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; |
Aron Virginas-Tar | e89ebad | 2019-08-27 18:14:26 +0100 | [diff] [blame] | 59 | }; |
Sadik Armagan | 483c811 | 2021-06-01 09:24:52 +0100 | [diff] [blame] | 60 | |
| 61 | |
| 62 | |
| 63 | |