NVIDIA DeepStream SDK API Reference

8.0 Release
ds3d::v2xinfer::Tensor Struct Reference

Detailed Description

Public Member Functions

template<typename T >
T * ptr () const
 
void * ptr () const
 
int64_t size (int index) const
 
size_t bytes () const
 
bool empty () const
 
DataType dtype () const
 
bool device () const
 
void reference (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
void to_device_ (void *stream=nullptr)
 
void to_host_ (void *stream=nullptr)
 
Tensor to_device (void *stream=nullptr) const
 
Tensor to_host (void *stream=nullptr) const
 
Tensor to_float (void *stream=nullptr) const
 
Tensor to_half (void *stream=nullptr) const
 
void create_ (std::vector< int64_t > shape, DataType dtype, bool device=true)
 
bool save (const std::string &file, void *stream=nullptr) const
 
void print (const char *prefix="Tensor", size_t offset=0, size_t num_per_line=10, size_t lines=1) const
 
void memset (unsigned char value=0, void *stream=nullptr)
 
void arange (void *stream=nullptr)
 
void release ()
 
void self_byte_check (size_t type_bytes) const
 
Tensor clone (void *stream) const
 
void copy_from_host (const void *data, void *stream)
 
void copy_from_device (const void *data, void *stream)
 
unsigned int offset (unsigned int idim) const
 
 Tensor ()=default
 
 Tensor (std::vector< int64_t > shape, DataType dtype, bool device=true)
 
template<typename T >
T * ptr () const
 
void * ptr () const
 
int64_t size (int index) const
 
size_t bytes () const
 
bool empty () const
 
DataType dtype () const
 
bool device () const
 
void reference (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
void to_device_ (void *stream=nullptr)
 
void to_host_ (void *stream=nullptr)
 
Tensor to_device (void *stream=nullptr) const
 
Tensor to_host (void *stream=nullptr) const
 
Tensor to_float (void *stream=nullptr) const
 
Tensor to_half (void *stream=nullptr) const
 
void create_ (std::vector< int64_t > shape, DataType dtype, bool device=true)
 
bool save (const std::string &file, void *stream=nullptr) const
 
void print (const char *prefix="Tensor", size_t offset=0, size_t num_per_line=10, size_t lines=1) const
 
void memset (unsigned char value=0, void *stream=nullptr)
 
void arange (void *stream=nullptr)
 
void release ()
 
void self_byte_check (size_t type_bytes) const
 
Tensor clone (void *stream) const
 
void copy_from_host (const void *data, void *stream)
 
void copy_from_device (const void *data, void *stream)
 
unsigned int offset (unsigned int idim) const
 
 Tensor ()=default
 
 Tensor (std::vector< int64_t > shape, DataType dtype, bool device=true)
 

Static Public Member Functions

static Tensor create (std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static Tensor from_data_reference (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static Tensor from_data (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true, void *stream=nullptr)
 
static Tensor load (const std::string &file, bool device=true, void *stream=nullptr)
 
static Tensor loadbinary (const std::string &file, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static bool save (const Tensor &tensor, const std::string &file, void *stream=nullptr)
 
static Tensor create (std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static Tensor from_data_reference (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static Tensor from_data (void *data, std::vector< int64_t > shape, DataType dtype, bool device=true, void *stream=nullptr)
 
static Tensor load (const std::string &file, bool device=true, void *stream=nullptr)
 
static Tensor loadbinary (const std::string &file, std::vector< int64_t > shape, DataType dtype, bool device=true)
 
static bool save (const Tensor &tensor, const std::string &file, void *stream=nullptr)
 

Data Fields

std::vector< int64_t > shape
 
std::shared_ptr< TensorDatadata
 
size_t numel = 0
 
size_t ndim = 0
 

Constructor & Destructor Documentation

◆ Tensor() [1/4]

ds3d::v2xinfer::Tensor::Tensor ( )
default

◆ Tensor() [2/4]

ds3d::v2xinfer::Tensor::Tensor ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

◆ Tensor() [3/4]

ds3d::v2xinfer::Tensor::Tensor ( )
default

◆ Tensor() [4/4]

ds3d::v2xinfer::Tensor::Tensor ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

Member Function Documentation

◆ arange() [1/2]

void ds3d::v2xinfer::Tensor::arange ( void *  stream = nullptr)

◆ arange() [2/2]

void ds3d::v2xinfer::Tensor::arange ( void *  stream = nullptr)

◆ bytes() [1/2]

size_t ds3d::v2xinfer::Tensor::bytes ( ) const
inline

◆ bytes() [2/2]

size_t ds3d::v2xinfer::Tensor::bytes ( ) const
inline

◆ clone() [1/2]

Tensor ds3d::v2xinfer::Tensor::clone ( void *  stream) const

◆ clone() [2/2]

Tensor ds3d::v2xinfer::Tensor::clone ( void *  stream) const

◆ copy_from_device() [1/2]

void ds3d::v2xinfer::Tensor::copy_from_device ( const void *  data,
void *  stream 
)

◆ copy_from_device() [2/2]

void ds3d::v2xinfer::Tensor::copy_from_device ( const void *  data,
void *  stream 
)

◆ copy_from_host() [1/2]

void ds3d::v2xinfer::Tensor::copy_from_host ( const void *  data,
void *  stream 
)

◆ copy_from_host() [2/2]

void ds3d::v2xinfer::Tensor::copy_from_host ( const void *  data,
void *  stream 
)

◆ create() [1/2]

static Tensor ds3d::v2xinfer::Tensor::create ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ create() [2/2]

static Tensor ds3d::v2xinfer::Tensor::create ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ create_() [1/2]

void ds3d::v2xinfer::Tensor::create_ ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

◆ create_() [2/2]

void ds3d::v2xinfer::Tensor::create_ ( std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

◆ device() [1/2]

bool ds3d::v2xinfer::Tensor::device ( ) const
inline

◆ device() [2/2]

bool ds3d::v2xinfer::Tensor::device ( ) const
inline

◆ dtype() [1/2]

DataType ds3d::v2xinfer::Tensor::dtype ( ) const
inline

◆ dtype() [2/2]

DataType ds3d::v2xinfer::Tensor::dtype ( ) const
inline

◆ empty() [1/2]

bool ds3d::v2xinfer::Tensor::empty ( ) const
inline

◆ empty() [2/2]

bool ds3d::v2xinfer::Tensor::empty ( ) const
inline

◆ from_data() [1/2]

static Tensor ds3d::v2xinfer::Tensor::from_data ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true,
void *  stream = nullptr 
)
static

◆ from_data() [2/2]

static Tensor ds3d::v2xinfer::Tensor::from_data ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true,
void *  stream = nullptr 
)
static

◆ from_data_reference() [1/2]

static Tensor ds3d::v2xinfer::Tensor::from_data_reference ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ from_data_reference() [2/2]

static Tensor ds3d::v2xinfer::Tensor::from_data_reference ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ load() [1/2]

static Tensor ds3d::v2xinfer::Tensor::load ( const std::string &  file,
bool  device = true,
void *  stream = nullptr 
)
static

◆ load() [2/2]

static Tensor ds3d::v2xinfer::Tensor::load ( const std::string &  file,
bool  device = true,
void *  stream = nullptr 
)
static

◆ loadbinary() [1/2]

static Tensor ds3d::v2xinfer::Tensor::loadbinary ( const std::string &  file,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ loadbinary() [2/2]

static Tensor ds3d::v2xinfer::Tensor::loadbinary ( const std::string &  file,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)
static

◆ memset() [1/2]

void ds3d::v2xinfer::Tensor::memset ( unsigned char  value = 0,
void *  stream = nullptr 
)

◆ memset() [2/2]

void ds3d::v2xinfer::Tensor::memset ( unsigned char  value = 0,
void *  stream = nullptr 
)

◆ offset() [1/2]

unsigned int ds3d::v2xinfer::Tensor::offset ( unsigned int  idim) const

◆ offset() [2/2]

unsigned int ds3d::v2xinfer::Tensor::offset ( unsigned int  idim) const

◆ print() [1/2]

void ds3d::v2xinfer::Tensor::print ( const char *  prefix = "Tensor",
size_t  offset = 0,
size_t  num_per_line = 10,
size_t  lines = 1 
) const

◆ print() [2/2]

void ds3d::v2xinfer::Tensor::print ( const char *  prefix = "Tensor",
size_t  offset = 0,
size_t  num_per_line = 10,
size_t  lines = 1 
) const

◆ ptr() [1/4]

template<typename T >
T* ds3d::v2xinfer::Tensor::ptr ( ) const
inline

◆ ptr() [2/4]

template<typename T >
T* ds3d::v2xinfer::Tensor::ptr ( ) const
inline

◆ ptr() [3/4]

void* ds3d::v2xinfer::Tensor::ptr ( ) const
inline

◆ ptr() [4/4]

void* ds3d::v2xinfer::Tensor::ptr ( ) const
inline

◆ reference() [1/2]

void ds3d::v2xinfer::Tensor::reference ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

◆ reference() [2/2]

void ds3d::v2xinfer::Tensor::reference ( void *  data,
std::vector< int64_t >  shape,
DataType  dtype,
bool  device = true 
)

◆ release() [1/2]

void ds3d::v2xinfer::Tensor::release ( )

◆ release() [2/2]

void ds3d::v2xinfer::Tensor::release ( )

◆ save() [1/4]

bool ds3d::v2xinfer::Tensor::save ( const std::string &  file,
void *  stream = nullptr 
) const

◆ save() [2/4]

bool ds3d::v2xinfer::Tensor::save ( const std::string &  file,
void *  stream = nullptr 
) const

◆ save() [3/4]

static bool ds3d::v2xinfer::Tensor::save ( const Tensor tensor,
const std::string &  file,
void *  stream = nullptr 
)
static

◆ save() [4/4]

static bool ds3d::v2xinfer::Tensor::save ( const Tensor tensor,
const std::string &  file,
void *  stream = nullptr 
)
static

◆ self_byte_check() [1/2]

void ds3d::v2xinfer::Tensor::self_byte_check ( size_t  type_bytes) const

Referenced by ptr().

◆ self_byte_check() [2/2]

void ds3d::v2xinfer::Tensor::self_byte_check ( size_t  type_bytes) const

◆ size() [1/2]

int64_t ds3d::v2xinfer::Tensor::size ( int  index) const
inline

◆ size() [2/2]

int64_t ds3d::v2xinfer::Tensor::size ( int  index) const
inline

◆ to_device() [1/2]

Tensor ds3d::v2xinfer::Tensor::to_device ( void *  stream = nullptr) const

◆ to_device() [2/2]

Tensor ds3d::v2xinfer::Tensor::to_device ( void *  stream = nullptr) const

◆ to_device_() [1/2]

void ds3d::v2xinfer::Tensor::to_device_ ( void *  stream = nullptr)

◆ to_device_() [2/2]

void ds3d::v2xinfer::Tensor::to_device_ ( void *  stream = nullptr)

◆ to_float() [1/2]

Tensor ds3d::v2xinfer::Tensor::to_float ( void *  stream = nullptr) const

◆ to_float() [2/2]

Tensor ds3d::v2xinfer::Tensor::to_float ( void *  stream = nullptr) const

◆ to_half() [1/2]

Tensor ds3d::v2xinfer::Tensor::to_half ( void *  stream = nullptr) const

◆ to_half() [2/2]

Tensor ds3d::v2xinfer::Tensor::to_half ( void *  stream = nullptr) const

◆ to_host() [1/2]

Tensor ds3d::v2xinfer::Tensor::to_host ( void *  stream = nullptr) const

◆ to_host() [2/2]

Tensor ds3d::v2xinfer::Tensor::to_host ( void *  stream = nullptr) const

◆ to_host_() [1/2]

void ds3d::v2xinfer::Tensor::to_host_ ( void *  stream = nullptr)

◆ to_host_() [2/2]

void ds3d::v2xinfer::Tensor::to_host_ ( void *  stream = nullptr)

Field Documentation

◆ data

std::shared_ptr< TensorData > ds3d::v2xinfer::Tensor::data

◆ ndim

size_t ds3d::v2xinfer::Tensor::ndim = 0

◆ numel

size_t ds3d::v2xinfer::Tensor::numel = 0

◆ shape

std::vector< int64_t > ds3d::v2xinfer::Tensor::shape

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