Holds the underlying tensor data alongside metadata (shape, layout, datatype). Non-strided tensor data is not supported for use right now, use TensorDataStrided to use strided tensor data instead.
More...
#include <tensor_data.hpp>
|
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 |
|
Holds the underlying tensor data alongside metadata (shape, layout, datatype). Non-strided tensor data is not supported for use right now, use TensorDataStrided to use strided tensor data instead.
◆ TensorData() [1/2]
roccv::TensorData::TensorData |
( |
| ) |
|
|
delete |
◆ ~TensorData()
virtual roccv::TensorData::~TensorData |
( |
| ) |
|
|
virtualdefault |
◆ TensorData() [2/2]
◆ basePtr()
virtual void* roccv::TensorData::basePtr |
( |
| ) |
const |
|
virtual |
Returns the base pointer of the tensor data in memory.
- Returns
- A pointer to the tensor data in memory.
◆ cast()
template<typename Derived >
std::optional<Derived> roccv::TensorData::cast |
( |
| ) |
|
|
inline |
◆ device()
virtual const eDeviceType roccv::TensorData::device |
( |
| ) |
const |
|
virtual |
Retrieves the location where the tensor data is allocated, either on the device or the host.
- Returns
- An enum representing the data location of this tensor data.
◆ dtype()
virtual const DataType& roccv::TensorData::dtype |
( |
| ) |
const |
|
virtual |
Retrieves the data type of the tensor's elements.
- Returns
- The data type of the tensor's elements.
◆ rank()
virtual int roccv::TensorData::rank |
( |
| ) |
const |
|
virtual |
Returns the rank (the number of dimensions) of the tensor data.
- Returns
- the rank of the tensor
◆ shape() [1/2]
virtual const TensorShape& roccv::TensorData::shape |
( |
| ) |
const & |
|
virtual |
Returns the shape of the tensor.
- Returns
- const TensorShape&
◆ shape() [2/2]
virtual const int64_t roccv::TensorData::shape |
( |
int |
d | ) |
const & |
|
virtual |
Retrieves a specific dimension size from the tensor shape.
- Parameters
-
[in] | d | The index of the dimension. |
- Returns
- The size of the specified dimension.
◆ m_buffer
◆ m_deviceType
◆ m_dtype
◆ m_shape
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