ArmNN
 21.02
LayerTestResult.hpp File Reference
#include <armnn/Tensor.hpp>
#include <armnn/utility/Assert.hpp>
#include <boost/multi_array.hpp>
#include <cstddef>

Go to the source code of this file.

Classes

struct  LayerTestResult< T, n >
 

Functions

template<std::size_t n>
boost::array< unsigned int, n > GetTensorShapeAsArray (const armnn::TensorInfo &tensorInfo)
 

Function Documentation

◆ GetTensorShapeAsArray()

boost::array<unsigned int, n> GetTensorShapeAsArray ( const armnn::TensorInfo tensorInfo)

Definition at line 16 of file LayerTestResult.hpp.

References ARMNN_ASSERT_MSG, TensorInfo::GetNumDimensions(), and TensorInfo::GetShape().

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 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:187
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:191