23.11
|
Accessor implementation for Tensor objects. More...
#include <Accessor.h>
Public Member Functions | |
Accessor (ITensor &tensor) | |
Create an accessor for the given tensor . More... | |
Accessor (const Accessor &)=delete | |
Prevent instances of this class from being copy constructed. More... | |
Accessor & | operator= (const Accessor &)=delete |
Prevent instances of this class from being copied. More... | |
Accessor (Accessor &&)=default | |
Allow instances of this class to be move constructed. More... | |
const void * | data () const |
Get the tensor data. More... | |
void * | data () |
Get the tensor data. More... | |
TensorShape | shape () const override |
Shape of the tensor. More... | |
size_t | element_size () const override |
Size of each element in the tensor in bytes. More... | |
size_t | size () const override |
Total size of the tensor in bytes. More... | |
Format | format () const override |
Image format of the tensor. More... | |
DataLayout | data_layout () const override |
Data layout of the tensor. More... | |
DataType | data_type () const override |
Data type of the tensor. More... | |
int | num_channels () const override |
Number of channels of the tensor. More... | |
int | num_elements () const override |
Number of elements of the tensor. More... | |
PaddingSize | padding () const override |
Available padding around the tensor. More... | |
QuantizationInfo | quantization_info () const override |
Quantization info in case of asymmetric quantized type. More... | |
const void * | operator() (const Coordinates &coord) const override |
Read only access to the specified element. More... | |
void * | operator() (const Coordinates &coord) override |
Access to the specified element. More... | |
![]() | |
virtual | ~IAccessor ()=default |
Virtual destructor. More... | |
Accessor implementation for Tensor objects.
Definition at line 35 of file Accessor.h.
Create an accessor for the given tensor
.
[in,out] | tensor | To be accessed tensor. |
Definition at line 79 of file Accessor.h.
References tensor.
void* data | ( | ) |
Get the tensor data.
|
inline |
Get the tensor data.
Definition at line 134 of file Accessor.h.
References ITensor::buffer().
|
inlineoverridevirtual |
Data layout of the tensor.
Implements IAccessor.
Definition at line 104 of file Accessor.h.
References ITensorInfo::data_layout(), and ITensor::info().
|
inlineoverridevirtual |
Data type of the tensor.
Implements IAccessor.
Definition at line 109 of file Accessor.h.
References ITensorInfo::data_type(), and ITensor::info().
|
inlineoverridevirtual |
Size of each element in the tensor in bytes.
Implements IAccessor.
Definition at line 89 of file Accessor.h.
References ITensorInfo::element_size(), and ITensor::info().
|
inlineoverridevirtual |
Image format of the tensor.
Implements IAccessor.
Definition at line 99 of file Accessor.h.
References ITensorInfo::format(), and ITensor::info().
|
inlineoverridevirtual |
Number of channels of the tensor.
Implements IAccessor.
Definition at line 114 of file Accessor.h.
References ITensor::info(), and ITensorInfo::num_channels().
|
inlineoverridevirtual |
Number of elements of the tensor.
Implements IAccessor.
Definition at line 119 of file Accessor.h.
References ITensor::info(), ITensorInfo::tensor_shape(), and TensorShape::total_size().
|
inlineoverridevirtual |
Read only access to the specified element.
[in] | coord | Coordinates of the desired element. |
Implements IAccessor.
Definition at line 144 of file Accessor.h.
References ITensor::ptr_to_element().
|
inlineoverridevirtual |
Access to the specified element.
[in] | coord | Coordinates of the desired element. |
Implements IAccessor.
Definition at line 149 of file Accessor.h.
References ITensor::ptr_to_element().
|
inlineoverridevirtual |
Available padding around the tensor.
Implements IAccessor.
Definition at line 124 of file Accessor.h.
References ITensor::info(), and ITensorInfo::padding().
|
inlineoverridevirtual |
Quantization info in case of asymmetric quantized type.
Implements IAccessor.
Definition at line 129 of file Accessor.h.
References ITensor::info(), and ITensorInfo::quantization_info().
|
inlineoverridevirtual |
Shape of the tensor.
Implements IAccessor.
Definition at line 84 of file Accessor.h.
References ITensor::info(), and ITensorInfo::tensor_shape().
|
inlineoverridevirtual |
Total size of the tensor in bytes.
Implements IAccessor.
Definition at line 94 of file Accessor.h.
References ITensor::info(), and ITensorInfo::total_size().