ArmNN
 26.01
Loading...
Searching...
No Matches
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()

template<typename DataType >
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 }
#define ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(_cond, _str)
unsigned int GetNumDimensions() const
Function that returns the tensor rank.
Definition Tensor.cpp:174

References ARMNN_THROW_INVALIDARG_MSG_IF_FALSE, and TensorShape::GetNumDimensions().

Member Function Documentation

◆ Get()

template<typename DataType >
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 }
unsigned int GetIndex(const armnn::TensorShape &shape, unsigned int batchIndex, unsigned int channelIndex, unsigned int heightIndex, unsigned int widthIndex) const

References DataLayoutIndexed::GetIndex().


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