blob: c277d2d5e1e5bebd688ed4ea8a2e750060931f49 [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>
9
10#include <boost/multi_array.hpp>
11
12#include <cstddef>
13
14template <std::size_t n>
15boost::array<unsigned int, n> GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo)
16{
17 BOOST_ASSERT_MSG(n == tensorInfo.GetNumDimensions(),
18 "Attempting to construct a shape array of mismatching size");
19
20 boost::array<unsigned int, n> shape;
21 for (unsigned int i = 0; i < n; i++)
22 {
23 shape[i] = tensorInfo.GetShape()[i];
24 }
25 return shape;
26}
27
28template <typename T, std::size_t n>
29struct LayerTestResult
30{
31 LayerTestResult(const armnn::TensorInfo& outputInfo)
32 {
33 auto shape( GetTensorShapeAsArray<n>(outputInfo) );
34 output.resize(shape);
35 outputExpected.resize(shape);
36 supported = true;
37 compareBoolean = false;
38 }
39
40 boost::multi_array<T, n> output;
41 boost::multi_array<T, n> outputExpected;
42 bool supported;
43 bool compareBoolean;
44};