NVIDIA DeepStream SDK API Reference

6.4 Release
cvcore::TensorBase Class Reference

Detailed Description

Implementation of TensorBase class.

Definition at line 120 of file Tensor.h.

Inheritance diagram for cvcore::TensorBase:

Data Structures

struct  DimData
 Struct for storing dimension data. More...
 

Public Member Functions

 TensorBase (ChannelType type, const DimData *dimData, int dimCount, void *dataPtr, bool isCPU)
 Constructor of a non-owning tensor. More...
 
 TensorBase (ChannelType type, std::initializer_list< DimData > dimData, void *dataPtr, bool isCPU)
 Constructor of a non-owning tensor. More...
 
 TensorBase (ChannelType type, const DimData *dimData, int dimCount, bool isCPU)
 Constructor of a memory-owning tensor. More...
 
 TensorBase (ChannelType type, std::initializer_list< DimData > dimData, bool isCPU)
 Constructor of a memory-owning tensor. More...
 
 ~TensorBase ()
 Destructor of Tensor. More...
 
 TensorBase (const TensorBase &)=delete
 TensorBase is non-copyable. More...
 
TensorBaseoperator= (const TensorBase &)=delete
 TensorBase is non-copyable. More...
 
 TensorBase (TensorBase &&)
 Move Constructor of TensorBase. More...
 
TensorBaseoperator= (TensorBase &&)
 Move operator of TensorBase. More...
 
int getDimCount () const
 Get the dimension count of TensorBase. More...
 
std::size_t getSize (int dimIdx) const
 Get the size of given dimension. More...
 
std::size_t getStride (int dimIdx) const
 Get the stride of given dimension. More...
 
ChannelType getType () const
 Get the ChannelType of the Tensor. More...
 
void * getData () const
 Get the raw data pointer to the Tensor. More...
 
std::size_t getDataSize () const
 Get the total size of the Tensor in bytes. More...
 
bool isCPU () const
 Get the flag whether the Tensor is allocated in CPU or GPU. More...
 
bool isOwning () const
 Get the flag whether the Tensor owns the data. More...
 

Protected Member Functions

 TensorBase ()
 

Constructor & Destructor Documentation

◆ TensorBase() [1/7]

cvcore::TensorBase::TensorBase ( ChannelType  type,
const DimData dimData,
int  dimCount,
void *  dataPtr,
bool  isCPU 
)

Constructor of a non-owning tensor.

Parameters
typeChannelType of the Tensor.
dimDatapointer to the DimData array.
dimCountnumber of dimensions.
dataPtrraw pointer to the source data array.
isCPUwhether to allocate tensor on CPU or GPU.

◆ TensorBase() [2/7]

cvcore::TensorBase::TensorBase ( ChannelType  type,
std::initializer_list< DimData dimData,
void *  dataPtr,
bool  isCPU 
)

Constructor of a non-owning tensor.

Parameters
typeChannelType of the Tensor.
dimDatainitializer_list of DimData.
dataPtrraw pointer to the source data array.
isCPUwhether to allocate tensor on CPU or GPU.

◆ TensorBase() [3/7]

cvcore::TensorBase::TensorBase ( ChannelType  type,
const DimData dimData,
int  dimCount,
bool  isCPU 
)

Constructor of a memory-owning tensor.

Parameters
typeChannelType of the Tensor.
dimDatapointer to the DimData array.
dimCountnumber of dimensions.
isCPUwhether to allocate tensor on CPU or GPU.

◆ TensorBase() [4/7]

cvcore::TensorBase::TensorBase ( ChannelType  type,
std::initializer_list< DimData dimData,
bool  isCPU 
)

Constructor of a memory-owning tensor.

Parameters
typeChannelType of the Tensor.
dimDatainitializer_list of DimData.
isCPUwhether to allocate tensor on CPU or GPU.

◆ ~TensorBase()

cvcore::TensorBase::~TensorBase ( )

Destructor of Tensor.

◆ TensorBase() [5/7]

cvcore::TensorBase::TensorBase ( const TensorBase )
delete

TensorBase is non-copyable.

◆ TensorBase() [6/7]

cvcore::TensorBase::TensorBase ( TensorBase &&  )

Move Constructor of TensorBase.

◆ TensorBase() [7/7]

cvcore::TensorBase::TensorBase ( )
protected

Member Function Documentation

◆ getData()

void* cvcore::TensorBase::getData ( ) const

◆ getDataSize()

std::size_t cvcore::TensorBase::getDataSize ( ) const

Get the total size of the Tensor in bytes.

Returns
total bytes of the Tensor.

◆ getDimCount()

int cvcore::TensorBase::getDimCount ( ) const

Get the dimension count of TensorBase.

Returns
number of dimensions.

◆ getSize()

◆ getStride()

std::size_t cvcore::TensorBase::getStride ( int  dimIdx) const

Get the stride of given dimension.

Parameters
dimIdxdimension index.
Returns
stride of the specified dimension.

◆ getType()

ChannelType cvcore::TensorBase::getType ( ) const

Get the ChannelType of the Tensor.

Returns
ChannelType of the Tensor.

◆ isCPU()

bool cvcore::TensorBase::isCPU ( ) const

Get the flag whether the Tensor is allocated in CPU or GPU.

Returns
whether the Tensor is allocated in CPU.

◆ isOwning()

bool cvcore::TensorBase::isOwning ( ) const

Get the flag whether the Tensor owns the data.

Returns
whether the Tensor owns data in memory.

◆ operator=() [1/2]

TensorBase& cvcore::TensorBase::operator= ( const TensorBase )
delete

TensorBase is non-copyable.

◆ operator=() [2/2]

TensorBase& cvcore::TensorBase::operator= ( TensorBase &&  )

Move operator of TensorBase.


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