ArmNN
 23.05
BaseTensor< MemoryType > Class Template Reference

#include <Tensor.hpp>

Public Member Functions

 BaseTensor ()
 Empty (invalid) constructor. More...
 
 BaseTensor (const TensorInfo &info, MemoryType memoryArea)
 Constructor from a raw memory pointer. More...
 
 BaseTensor (const BaseTensor &other)
 Tensors are copyable. More...
 
BaseTensoroperator= (const BaseTensor &)
 Tensors are copyable. More...
 
const TensorInfoGetInfo () const
 
TensorInfoGetInfo ()
 
const TensorShapeGetShape () const
 
TensorShapeGetShape ()
 
DataType GetDataType () const
 
unsigned int GetNumDimensions () const
 
unsigned int GetNumBytes () const
 
unsigned int GetNumElements () const
 
MemoryType GetMemoryArea () const
 

Protected Member Functions

 ~BaseTensor ()
 Protected destructor to stop users from making these (could still new one on the heap and then leak it...) More...
 

Protected Attributes

MemoryType m_MemoryArea
 

Detailed Description

template<typename MemoryType>
class armnn::BaseTensor< MemoryType >

Definition at line 277 of file Tensor.hpp.

Constructor & Destructor Documentation

◆ BaseTensor() [1/3]

Empty (invalid) constructor.

Definition at line 524 of file Tensor.cpp.

525  : m_MemoryArea(nullptr)
526 {
527 }

◆ BaseTensor() [2/3]

BaseTensor ( const TensorInfo info,
MemoryType  memoryArea 
)

Constructor from a raw memory pointer.

Parameters
memoryArea- Region of CPU-addressable memory where tensor data will be stored. Must be valid while workloads are on the fly. Tensor instances do not claim ownership of referenced memory regions, that is, no attempt will be made by ArmNN to free these memory regions automatically.

Definition at line 530 of file Tensor.cpp.

531  : m_MemoryArea(memoryArea)
532  , m_Info(info)
533 {
534 }

◆ BaseTensor() [3/3]

BaseTensor ( const BaseTensor< MemoryType > &  other)

Tensors are copyable.

◆ ~BaseTensor()

~BaseTensor ( )
inlineprotected

Protected destructor to stop users from making these (could still new one on the heap and then leak it...)

Definition at line 310 of file Tensor.hpp.

310 {}

Member Function Documentation

◆ GetDataType()

DataType GetDataType ( ) const
inline

Definition at line 300 of file Tensor.hpp.

300 { return m_Info.GetDataType(); }

Referenced by armnn::ConvertWeightTensorFromArmnnToAcl().

◆ GetInfo() [1/2]

TensorInfo& GetInfo ( )
inline

Definition at line 296 of file Tensor.hpp.

296 { return m_Info; }

◆ GetInfo() [2/2]

◆ GetMemoryArea()

MemoryType GetMemoryArea ( ) const
inline

◆ GetNumBytes()

unsigned int GetNumBytes ( ) const
inline

Definition at line 302 of file Tensor.hpp.

302 { return m_Info.GetNumBytes(); }

Referenced by ScopedTensorHandle::ScopedTensorHandle().

◆ GetNumDimensions()

unsigned int GetNumDimensions ( ) const
inline

Definition at line 301 of file Tensor.hpp.

301 { return m_Info.GetNumDimensions(); }

◆ GetNumElements()

unsigned int GetNumElements ( ) const
inline

Definition at line 303 of file Tensor.hpp.

303 { return m_Info.GetNumElements(); }

Referenced by ConstTensorPin::GetConstTensorPtr(), and FuseBatchNorm< ConvLayer, ArmnnType, T >::Run().

◆ GetShape() [1/2]

TensorShape& GetShape ( )
inline

Definition at line 298 of file Tensor.hpp.

298 { return m_Info.GetShape(); }

◆ GetShape() [2/2]

const TensorShape& GetShape ( ) const
inline

Definition at line 297 of file Tensor.hpp.

297 { return m_Info.GetShape(); }

Referenced by armnn::ReorderWeightChannelsForAcl().

◆ operator=()

BaseTensor< MemoryType > & operator= ( const BaseTensor< MemoryType > &  )

Tensors are copyable.

Definition at line 544 of file Tensor.cpp.

545 {
546  m_Info = other.m_Info;
547  m_MemoryArea = other.m_MemoryArea;
548  return *this;
549 }

Member Data Documentation

◆ m_MemoryArea

MemoryType m_MemoryArea
protected

The documentation for this class was generated from the following files:
armnn::BaseTensor::m_MemoryArea
MemoryType m_MemoryArea
Definition: Tensor.hpp:312
armnn::TensorInfo::GetNumDimensions
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:195
armnn::TensorInfo::GetNumElements
unsigned int GetNumElements() const
Definition: Tensor.hpp:196
armnn::TensorInfo::GetShape
const TensorShape & GetShape() const
Definition: Tensor.hpp:191
armnn::TensorInfo::GetNumBytes
unsigned int GetNumBytes() const
Definition: Tensor.cpp:427
armnn::TensorInfo::GetDataType
DataType GetDataType() const
Definition: Tensor.hpp:198