|
|
NVIDIA DeepStream SDK API Reference
|
8.0 Release
|
Go to the documentation of this file.
32 #ifndef DEEPSTREAM_TENSOR_HPP
33 #define DEEPSTREAM_TENSOR_HPP
42 class TensorImplementation;
85 const int64_t
shape[],
86 const int64_t strides[],
89 unsigned int device_id,
104 unsigned int rank()
const;
119 unsigned int bits()
const;
124 uint64_t
stride(
unsigned int d)
const;
159 uint64_t
size()
const;
162 TensorImplementation*
impl_;
std::vector< uint64_t > TensorShape
Buffer wrap(NvBufSurfaceColorFormat format)
Wrap the tensor to a buffer.
uint64_t size() const
total size of the tensor in bytes
std::unique_ptr< Context > context_
Tensor(unsigned int rank, DataType dtype, unsigned int bits, const int64_t shape[], const int64_t strides[], void *data, std::string format, unsigned int device_id, DeviceType device, Context *context)
Construct from common tensor configurations.
void * data() const
Retrieve the allocated data pointer.
DataType
Code for tensor data types.
DeviceType deviceType() const
Retrieve the device type.
unsigned int rank() const
Number of dimenstions of the tensor.
Tensor * toGPU(unsigned int device_id) const
Copy the tensor to GPU.
Tensor * clone() const
Clone a tensor.
TensorImplementation * impl_
virtual ~Tensor()
Destructor.
TensorShape shape() const
Shape of the tensor in vector.
uint64_t stride(unsigned int d) const
Retrieve the stride of a specific dimension.
unsigned int deviceId() const
Retrieve the device id.
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
unsigned int bits() const
Number of bits for each data.
static std::string format(const char *fmt,...)
DataType dtype() const
Data type of the tensor elements.