ArmNN
 22.11
TensorBufferArrayView< DataType > Class Template Reference

#include <TensorBufferArrayView.hpp>

Public Member Functions

 TensorBufferArrayView (const TensorShape &shape, DataType *data, armnnUtils::DataLayoutIndexed dataLayout=DataLayout::NCHW)
 
DataTypeGet (unsigned int b, unsigned int c, unsigned int h, unsigned int w) const
 

Detailed Description

template<typename DataType>
class armnn::TensorBufferArrayView< DataType >

Definition at line 19 of file TensorBufferArrayView.hpp.

Constructor & Destructor Documentation

◆ TensorBufferArrayView()

TensorBufferArrayView ( const TensorShape shape,
DataType data,
armnnUtils::DataLayoutIndexed  dataLayout = DataLayout::NCHW 
)
inline

Definition at line 22 of file TensorBufferArrayView.hpp.

References ARMNN_ASSERT, and TensorShape::GetNumDimensions().

24  : m_Shape(shape)
25  , m_Data(data)
26  , m_DataLayout(dataLayout)
27  {
28  ARMNN_ASSERT(m_Shape.GetNumDimensions() == 4);
29  }
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition: Tensor.cpp:174

Member Function Documentation

◆ Get()

DataType& Get ( unsigned int  b,
unsigned int  c,
unsigned int  h,
unsigned int  w 
) const
inline

Definition at line 31 of file TensorBufferArrayView.hpp.

References DataLayoutIndexed::GetIndex().

32  {
33  return m_Data[m_DataLayout.GetIndex(m_Shape, b, c, h, w)];
34  }
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const

The documentation for this class was generated from the following file: