TensorDataStrided Class Reference#
3 min read time
Applies to Linux
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:

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... | |
![]() | |
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 DataType & | dtype () 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 TensorShape & | shape () 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 | |
![]() | |
TensorData (const TensorShape &tshape, const DataType &dtype, const TensorBufferStrided &buffer, const eDeviceType device=eDeviceType::GPU) | |
![]() | |
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] tshape The shape of the tensor. [in] dtype The datatype of the tensor. [in] buffer The buffer containing the tensor's underlying data. [in] data_location The 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] d The 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