ArmNN
 20.08
LayerTestResult.hpp
Go to the documentation of this file.
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>
10 
11 #include <boost/multi_array.hpp>
12 
13 #include <cstddef>
14 
15 template <std::size_t n>
16 boost::array<unsigned int, n> GetTensorShapeAsArray(const armnn::TensorInfo& tensorInfo)
17 {
18  ARMNN_ASSERT_MSG(n == tensorInfo.GetNumDimensions(),
19  "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 
29 template <typename T, std::size_t n>
31 {
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;
45 };
boost::array< unsigned int, n > GetTensorShapeAsArray(const armnn::TensorInfo &tensorInfo)
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
LayerTestResult(const armnn::TensorInfo &outputInfo)
boost::multi_array< T, n > outputExpected
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15
boost::multi_array< T, n > output
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:191