NVIDIA DeepStream SDK API Reference

6.4 Release
cvcore::Tensor< CDHW, CC, CT > Class Template Reference

Detailed Description

template<ChannelCount CC, ChannelType CT>
class cvcore::Tensor< CDHW, CC, CT >

4D CDHW tensors.

Template Parameters
CCchannel count.
CTchannel type.

Definition at line 1134 of file Tensor.h.

Inheritance diagram for cvcore::Tensor< CDHW, CC, CT >:
Collaboration diagram for cvcore::Tensor< CDHW, CC, CT >:

Public Types

using DataType = typename detail::ChannelTypeToNative< CT >::Type
 

Public Member Functions

 Tensor ()=default
 
template<ChannelCount T = CC, typename = typename std::enable_if<T != CX>::type>
 Tensor (std::size_t width, std::size_t height, std::size_t depth, bool isCPU=true)
 
template<ChannelCount T = CC, typename = typename std::enable_if<T == CX>::type>
 Tensor (std::size_t width, std::size_t height, std::size_t depth, std::size_t channelCount, bool isCPU=true)
 
template<ChannelCount T = CC, typename = typename std::enable_if<T != CX>::type>
 Tensor (std::size_t width, std::size_t height, std::size_t depth, DataType *dataPtr, bool isCPU=true)
 
template<ChannelCount T = CC, typename = typename std::enable_if<T == CX>::type>
 Tensor (std::size_t width, std::size_t height, std::size_t depth, std::size_t channelCount, DataType *dataPtr, bool isCPU=true)
 
std::size_t getWidth () const
 Get the width of the 4D tensor. More...
 
std::size_t getHeight () const
 Get the height of the 4D tensor. More...
 
std::size_t getDepth () const
 Get the depth of the 4D tensor. More...
 
std::size_t getChannelCount () const
 Get the channel count of the 4D tensor. More...
 
std::size_t getStride (TensorDimension dim) const
 Get the stride of the 4D tensor. More...
 
std::size_t getStride (int dimIdx) const
 Expose base getStride() function. More...
 
std::size_t getStride (int dimIdx) const
 Get the stride of given dimension. More...
 
DataTypegetData ()
 Get the raw data pointer to the 4D tensor. More...
 
const DataTypegetData () const
 Get the const raw data pointer to the 4D tensor. More...
 
void * getData () const
 Get the raw data pointer to the Tensor. 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...
 
ChannelType getType () const
 Get the ChannelType of 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...
 

Static Public Attributes

static constexpr ChannelCount kChannelCount = CC
 

Member Typedef Documentation

◆ DataType

template<ChannelCount CC, ChannelType CT>
using cvcore::Tensor< CDHW, CC, CT >::DataType = typename detail::ChannelTypeToNative<CT>::Type

Definition at line 1137 of file Tensor.h.

Constructor & Destructor Documentation

◆ Tensor() [1/5]

template<ChannelCount CC, ChannelType CT>
cvcore::Tensor< CDHW, CC, CT >::Tensor ( )
default

◆ Tensor() [2/5]

template<ChannelCount CC, ChannelType CT>
template<ChannelCount T = CC, typename = typename std::enable_if<T != CX>::type>
cvcore::Tensor< CDHW, CC, CT >::Tensor ( std::size_t  width,
std::size_t  height,
std::size_t  depth,
bool  isCPU = true 
)
inline

Definition at line 1144 of file Tensor.h.

◆ Tensor() [3/5]

template<ChannelCount CC, ChannelType CT>
template<ChannelCount T = CC, typename = typename std::enable_if<T == CX>::type>
cvcore::Tensor< CDHW, CC, CT >::Tensor ( std::size_t  width,
std::size_t  height,
std::size_t  depth,
std::size_t  channelCount,
bool  isCPU = true 
)
inline

Definition at line 1154 of file Tensor.h.

◆ Tensor() [4/5]

template<ChannelCount CC, ChannelType CT>
template<ChannelCount T = CC, typename = typename std::enable_if<T != CX>::type>
cvcore::Tensor< CDHW, CC, CT >::Tensor ( std::size_t  width,
std::size_t  height,
std::size_t  depth,
DataType dataPtr,
bool  isCPU = true 
)
inline

Definition at line 1161 of file Tensor.h.

◆ Tensor() [5/5]

template<ChannelCount CC, ChannelType CT>
template<ChannelCount T = CC, typename = typename std::enable_if<T == CX>::type>
cvcore::Tensor< CDHW, CC, CT >::Tensor ( std::size_t  width,
std::size_t  height,
std::size_t  depth,
std::size_t  channelCount,
DataType dataPtr,
bool  isCPU = true 
)
inline

Definition at line 1171 of file Tensor.h.

Member Function Documentation

◆ getChannelCount()

std::size_t cvcore::detail::Tensor4D< TL, CT >::getChannelCount
inlineinherited

Get the channel count of the 4D tensor.

Returns
channel count of the 4D tensor.

Definition at line 650 of file Tensor.h.

◆ getData() [1/3]

DataType* cvcore::detail::Tensor4D< TL, CT >::getData
inlineinherited

Get the raw data pointer to the 4D tensor.

Returns
data pointer to the 4D tensor.

Definition at line 686 of file Tensor.h.

◆ getData() [2/3]

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

◆ getData() [3/3]

const DataType* cvcore::detail::Tensor4D< TL, CT >::getData
inlineinherited

Get the const raw data pointer to the 4D tensor.

Returns
const data pointer to the 4D tensor.

Definition at line 695 of file Tensor.h.

◆ getDataSize()

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

Get the total size of the Tensor in bytes.

Returns
total bytes of the Tensor.

◆ getDepth()

std::size_t cvcore::detail::Tensor4D< TL, CT >::getDepth
inlineinherited

Get the depth of the 4D tensor.

Returns
depth of the 4D tensor.

Definition at line 641 of file Tensor.h.

◆ getDimCount()

int cvcore::TensorBase::getDimCount ( ) const
inherited

Get the dimension count of TensorBase.

Returns
number of dimensions.

◆ getHeight()

std::size_t cvcore::detail::Tensor4D< TL, CT >::getHeight
inlineinherited

Get the height of the 4D tensor.

Returns
height of the 4D tensor.

Definition at line 632 of file Tensor.h.

◆ getSize()

◆ getStride() [1/3]

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

Get the stride of given dimension.

Parameters
dimIdxdimension index.
Returns
stride of the specified dimension.

◆ getStride() [2/3]

std::size_t cvcore::TensorBase::getStride
inherited

Expose base getStride() function.

◆ getStride() [3/3]

std::size_t cvcore::detail::Tensor4D< TL, CT >::getStride ( TensorDimension  dim) const
inlineinherited

Get the stride of the 4D tensor.

Parameters
dimtensor dimension.
Returns
tensor stride of the given dimension.

Definition at line 665 of file Tensor.h.

◆ getType()

ChannelType cvcore::TensorBase::getType ( ) const
inherited

Get the ChannelType of the Tensor.

Returns
ChannelType of the Tensor.

◆ getWidth()

std::size_t cvcore::detail::Tensor4D< TL, CT >::getWidth
inlineinherited

Get the width of the 4D tensor.

Returns
width of the 4D tensor.

Definition at line 623 of file Tensor.h.

◆ isCPU()

bool cvcore::TensorBase::isCPU ( ) const
inherited

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
inherited

Get the flag whether the Tensor owns the data.

Returns
whether the Tensor owns data in memory.

Field Documentation

◆ kChannelCount

template<ChannelCount CC, ChannelType CT>
constexpr ChannelCount cvcore::Tensor< CDHW, CC, CT >::kChannelCount = CC
staticconstexpr

Definition at line 1139 of file Tensor.h.


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