Compute Library
18.05
|
Accessor implementation for Tensor objects. More...
#include <Accessor.h>
Public Member Functions | |
Accessor (Tensor &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... | |
Accessor & | operator= (Accessor &&)=default |
Allow instances of this class to be moved. 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... | |
int | fixed_point_position () const override |
Number of bits for the fractional part. 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... | |
Public Member Functions inherited from IAccessor | |
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 82 of file Accessor.h.
|
inline |
Get the tensor data.
Definition at line 142 of file Accessor.h.
References Tensor::buffer().
|
inline |
Get the tensor data.
Definition at line 147 of file Accessor.h.
References Tensor::buffer().
|
inlineoverridevirtual |
Data layout of the tensor.
Implements IAccessor.
Definition at line 107 of file Accessor.h.
References ITensorInfo::data_layout(), and Tensor::info().
|
inlineoverridevirtual |
Data type of the tensor.
Implements IAccessor.
Definition at line 112 of file Accessor.h.
References ITensorInfo::data_type(), and Tensor::info().
|
inlineoverridevirtual |
Size of each element in the tensor in bytes.
Implements IAccessor.
Definition at line 92 of file Accessor.h.
References ITensorInfo::element_size(), and Tensor::info().
|
inlineoverridevirtual |
Number of bits for the fractional part.
Implements IAccessor.
Definition at line 132 of file Accessor.h.
References ITensorInfo::fixed_point_position(), and Tensor::info().
|
inlineoverridevirtual |
Image format of the tensor.
Implements IAccessor.
Definition at line 102 of file Accessor.h.
References ITensorInfo::format(), and Tensor::info().
|
inlineoverridevirtual |
Number of channels of the tensor.
Implements IAccessor.
Definition at line 117 of file Accessor.h.
References Tensor::info(), and ITensorInfo::num_channels().
|
inlineoverridevirtual |
Number of elements of the tensor.
Implements IAccessor.
Definition at line 122 of file Accessor.h.
References Tensor::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 152 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 157 of file Accessor.h.
References ITensor::ptr_to_element().
|
inlineoverridevirtual |
Available padding around the tensor.
Implements IAccessor.
Definition at line 127 of file Accessor.h.
References Tensor::info(), and ITensorInfo::padding().
|
inlineoverridevirtual |
Quantization info in case of asymmetric quantized type.
Implements IAccessor.
Definition at line 137 of file Accessor.h.
References Tensor::info(), and ITensorInfo::quantization_info().
|
inlineoverridevirtual |
Shape of the tensor.
Implements IAccessor.
Definition at line 87 of file Accessor.h.
References Tensor::info(), and ITensorInfo::tensor_shape().
Referenced by LeNet5Network< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, FullyConnectedLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), MobileNetNetwork< TensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionLayerFunction, ReshapeFunction, PoolingLayerFunction >::get_classifications(), MobileNetV1Network< TensorType, Accessor, ActivationLayerFunction, BatchNormalizationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, DepthwiseConvolutionFunction, ReshapeFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications(), and AlexNetNetwork< ITensorType, TensorType, SubTensorType, Accessor, ActivationLayerFunction, ConvolutionLayerFunction, DirectConvolutionLayerFunction, FullyConnectedLayerFunction, NormalizationLayerFunction, PoolingLayerFunction, SoftmaxLayerFunction >::get_classifications().
|
inlineoverridevirtual |
Total size of the tensor in bytes.
Implements IAccessor.
Definition at line 97 of file Accessor.h.
References Tensor::info(), and ITensorInfo::total_size().