ArmNN
 24.02
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.

24  : m_Shape(shape)
25  , m_Data(data)
26  , m_DataLayout(dataLayout)
27  {
28  ARMNN_ASSERT(m_Shape.GetNumDimensions() == 4);
29  }

References ARMNN_ASSERT, and TensorShape::GetNumDimensions().

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.

32  {
33  return m_Data[m_DataLayout.GetIndex(m_Shape, b, c, h, w)];
34  }

References DataLayoutIndexed::GetIndex().


The documentation for this class was generated from the following file:
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::TensorShape::GetNumDimensions
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition: Tensor.cpp:174
armnnUtils::DataLayoutIndexed::GetIndex
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const
Definition: DataLayoutIndexed.hpp:28