ArmNN
 26.01
Loading...
Searching...
No Matches
BaseTensor< MemoryType > Class Template Reference

#include <Tensor.hpp>

Inheritance diagram for BaseTensor< MemoryType >:
[legend]

Public Member Functions

 BaseTensor ()
 Empty (invalid) constructor.
 
 BaseTensor (const TensorInfo &info, MemoryType memoryArea)
 Constructor from a raw memory pointer.
 
 BaseTensor (const BaseTensor &other)
 Tensors are copyable.
 
BaseTensoroperator= (const BaseTensor &)
 Tensors are copyable.
 
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...)
 

Protected Attributes

MemoryType m_MemoryArea
 

Detailed Description

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

Definition at line 279 of file Tensor.hpp.

Constructor & Destructor Documentation

◆ BaseTensor() [1/3]

template<typename MemoryType >
BaseTensor ( )

Empty (invalid) constructor.

Definition at line 528 of file Tensor.cpp.

529 : m_MemoryArea(nullptr)
530{
531}
MemoryType m_MemoryArea
Definition Tensor.hpp:314

◆ BaseTensor() [2/3]

template<typename MemoryType >
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 534 of file Tensor.cpp.

535 : m_MemoryArea(memoryArea)
536 , m_Info(info)
537{
538}

◆ BaseTensor() [3/3]

template<typename MemoryType >
BaseTensor ( const BaseTensor< MemoryType > & other)

Tensors are copyable.

◆ ~BaseTensor()

template<typename MemoryType >
~BaseTensor ( )
inlineprotected

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

Definition at line 312 of file Tensor.hpp.

312{}

Member Function Documentation

◆ GetDataType()

template<typename MemoryType >
DataType GetDataType ( ) const
inline

Definition at line 302 of file Tensor.hpp.

302{ return m_Info.GetDataType(); }
DataType GetDataType() const
Definition Tensor.hpp:200

References TensorInfo::GetDataType().

Referenced by armnn::ConvertWeightTensorFromArmnnToAcl().

◆ GetInfo() [1/2]

template<typename MemoryType >
TensorInfo & GetInfo ( )
inline

Definition at line 298 of file Tensor.hpp.

298{ return m_Info; }

◆ GetInfo() [2/2]

template<typename MemoryType >
const TensorInfo & GetInfo ( ) const
inline

◆ GetMemoryArea()

template<typename MemoryType >
MemoryType GetMemoryArea ( ) const
inline

◆ GetNumBytes()

template<typename MemoryType >
unsigned int GetNumBytes ( ) const
inline

Definition at line 304 of file Tensor.hpp.

304{ return m_Info.GetNumBytes(); }
unsigned int GetNumBytes() const
Definition Tensor.cpp:427

References TensorInfo::GetNumBytes().

Referenced by ScopedTensorHandle::ScopedTensorHandle().

◆ GetNumDimensions()

template<typename MemoryType >
unsigned int GetNumDimensions ( ) const
inline

Definition at line 303 of file Tensor.hpp.

303{ return m_Info.GetNumDimensions(); }
unsigned int GetNumDimensions() const
Definition Tensor.hpp:197

References TensorInfo::GetNumDimensions().

◆ GetNumElements()

template<typename MemoryType >
unsigned int GetNumElements ( ) const
inline

Definition at line 305 of file Tensor.hpp.

305{ return m_Info.GetNumElements(); }
unsigned int GetNumElements() const
Definition Tensor.hpp:198

References TensorInfo::GetNumElements().

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

◆ GetShape() [1/2]

template<typename MemoryType >
TensorShape & GetShape ( )
inline

Definition at line 300 of file Tensor.hpp.

300{ return m_Info.GetShape(); }
const TensorShape & GetShape() const
Definition Tensor.hpp:193

References TensorInfo::GetShape().

◆ GetShape() [2/2]

template<typename MemoryType >
const TensorShape & GetShape ( ) const
inline

Definition at line 299 of file Tensor.hpp.

299{ return m_Info.GetShape(); }

References TensorInfo::GetShape().

Referenced by armnn::ReorderWeightChannelsForAcl().

◆ operator=()

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

Tensors are copyable.

Definition at line 548 of file Tensor.cpp.

549{
550 m_Info = other.m_Info;
551 m_MemoryArea = other.m_MemoryArea;
552 return *this;
553}

References BaseTensor< MemoryType >::m_MemoryArea.

Member Data Documentation

◆ m_MemoryArea

template<typename MemoryType >
MemoryType m_MemoryArea
protected

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