ArmNN
 24.08
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 17 of file TensorBufferArrayView.hpp.

Constructor & Destructor Documentation

◆ TensorBufferArrayView()

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

Definition at line 20 of file TensorBufferArrayView.hpp.

22  : m_Shape(shape)
23  , m_Data(data)
24  , m_DataLayout(dataLayout)
25  {
27  "Only $d tensors are supported by TensorBufferArrayView.");
28  }

References ARMNN_THROW_INVALIDARG_MSG_IF_FALSE, 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 30 of file TensorBufferArrayView.hpp.

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

References DataLayoutIndexed::GetIndex().


The documentation for this class was generated from the following file:
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
ARMNN_THROW_INVALIDARG_MSG_IF_FALSE
#define ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(_cond, _str)
Definition: Exceptions.hpp:210