TensorDataStrided Class Reference

TensorDataStrided Class Reference#

3 min read time

Applies to Linux

rocCV: roccv::TensorDataStrided Class Reference
roccv::TensorDataStrided Class Reference

Holds the underlying tensor data alongside tensor metadata. This particular tensor data type is used to store strided data, and contains additional methods for handling strided data. More...

#include <tensor_data.hpp>

Inheritance diagram for roccv::TensorDataStrided:
roccv::TensorData

Public Types

using Buffer = TensorBufferStrided
 

Public Member Functions

const int64_t stride (int d) const
 Returns the stride at a given dimension. More...
 
 TensorDataStrided (const TensorShape &tshape, const DataType &dtype, const TensorBufferStrided &buffer, const eDeviceType device=eDeviceType::GPU)
 Constructs a TensorDataStrided object. More...
 
- Public Member Functions inherited from roccv::TensorData
virtual void * basePtr () const
 Returns the base pointer of the tensor data in memory. More...
 
template<typename Derived >
std::optional< Derived > cast ()
 
virtual const eDeviceType device () const
 Retrieves the location where the tensor data is allocated, either on the device or the host. More...
 
virtual const DataTypedtype () const
 Retrieves the data type of the tensor's elements. More...
 
virtual int rank () const
 Returns the rank (the number of dimensions) of the tensor data. More...
 
virtual const TensorShapeshape () const &
 Returns the shape of the tensor. More...
 
virtual const int64_t shape (int d) const &
 Retrieves a specific dimension size from the tensor shape. More...
 
 TensorData ()=delete
 
virtual ~TensorData ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from roccv::TensorData
 TensorData (const TensorShape &tshape, const DataType &dtype, const TensorBufferStrided &buffer, const eDeviceType device=eDeviceType::GPU)
 
- Protected Attributes inherited from roccv::TensorData
TensorBufferStrided m_buffer
 
eDeviceType m_deviceType
 
DataType m_dtype
 
TensorShape m_shape
 

Detailed Description

Holds the underlying tensor data alongside tensor metadata. This particular tensor data type is used to store strided data, and contains additional methods for handling strided data.

Member Typedef Documentation

◆ Buffer

Constructor & Destructor Documentation

◆ TensorDataStrided()

roccv::TensorDataStrided::TensorDataStrided ( const TensorShape tshape,
const DataType dtype,
const TensorBufferStrided buffer,
const eDeviceType  device = eDeviceType::GPU 
)

Constructs a TensorDataStrided object.

Parameters
[in]tshapeThe shape of the tensor.
[in]dtypeThe datatype of the tensor.
[in]bufferThe buffer containing the tensor's underlying data.
[in]data_locationThe data location of the tensor (default: DATA_ON_DEVICE).

Member Function Documentation

◆ stride()

const int64_t roccv::TensorDataStrided::stride ( int  d) const

Returns the stride at a given dimension.

Parameters
[in]dThe specified dimension of the tensor.
Returns
The stride for the given dimension.

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/tensor_data.hpp