ArmNN
 25.11
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 {
26 ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(m_Shape.GetNumDimensions() == 4,
27 "Only $d tensors are supported by TensorBufferArrayView.");
28 }
#define ARMNN_THROW_INVALIDARG_MSG_IF_FALSE(_cond, _str)

References ARMNN_THROW_INVALIDARG_MSG_IF_FALSE, and armnn::NCHW.

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 }

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