blob: ac6076496483bf0b19fe0a5ca96b68bfc31edb9b [file] [log] [blame]
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +01001//
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 Prangnawaratac2770a2020-04-01 16:51:23 +01009#include <armnn/utility/Assert.hpp>
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +010010
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +010011#include <cstddef>
Sadik Armagan483c8112021-06-01 09:24:52 +010012#include <vector>
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +010013
14template <typename T, std::size_t n>
15struct LayerTestResult
16{
17 LayerTestResult(const armnn::TensorInfo& outputInfo)
Sadik Armagan483c8112021-06-01 09:24:52 +010018 : m_Supported(true)
19 , m_CompareBoolean(false)
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +010020 {
Sadik Armagan483c8112021-06-01 09:24:52 +010021 m_ActualData.reserve(outputInfo.GetNumElements());
22 m_ExpectedData.reserve(outputInfo.GetNumElements());
23 m_ActualShape = outputInfo.GetShape();
24 m_ExpectedShape = outputInfo.GetShape();
Aron Virginas-Tare89ebad2019-08-27 18:14:26 +010025 }
26
Sadik Armagan483c8112021-06-01 09:24:52 +010027 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-Tare89ebad2019-08-27 18:14:26 +010059};
Sadik Armagan483c8112021-06-01 09:24:52 +010060
61
62
63