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