24 #ifndef __ARM_COMPUTE_SUBTENSORINFO_H__ 25 #define __ARM_COMPUTE_SUBTENSORINFO_H__ 76 std::unique_ptr<ITensorInfo>
clone()
const override;
128 return _tensor_shape[index];
168 return _tensor_shape;
208 return _valid_region;
size_t element_size() const override
Element size in bytes calculated as data_size() * num_channels()
virtual ITensorInfo & set_num_channels(int num_channels)=0
Set the number of channels to the specified value.
size_t offset_element_in_bytes(const Coordinates &pos) const override
The offset in bytes from the beginning of the memory allocation to access the element at position (x...
size_t total_size() const override
Returns the total size of the tensor in bytes.
ITensorInfo & set_is_resizable(bool is_resizable) override
Set the flag whether the tensor size can be changed.
bool extend_padding(const PaddingSize &padding) override
Update the offset to the first element, the strides and the total size.
Container for 2D border size.
virtual ITensorInfo & set_fixed_point_position(int fixed_point_position)=0
Set the fixed point position to the specified value.
DataLayoutDimension
Supported tensor data layout dimensions.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
QuantizationInfo quantization_info() const override
Get the quantization settings (scale and offset) of the tensor.
DataLayout data_layout() const override
Get the data layout of the tensor.
virtual size_t offset_element_in_bytes(const Coordinates &pos) const =0
The offset in bytes from the beginning of the memory allocation to access the element at position (x...
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
ITensorInfo & set_tensor_shape(const TensorShape &shape) override
Set the shape of an already initialized tensor.
Store the tensor's metadata.
int fixed_point_position() const override
Fixed point position used when the tensor data type is QS8 or QS16.
ITensorInfo & set_format(Format format) override
Set the format of an already initialized tensor.
const Strides & strides_in_bytes() const override
The strides in bytes for accessing each dimension of the tensor.
virtual ITensorInfo & reset_padding()=0
Resets the padding settings of the tensor.
Store the sub tensor's metadata.
This file contains all available output stages for GEMMLowp on OpenCL.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
SubTensorInfo & operator=(const SubTensorInfo &)=default
Allow instances of this class to be copied.
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
size_t offset_first_element_in_bytes() const override
The offset from the beginning of the memory allocation to the first element of the tensor...
virtual Format format() const =0
Colour format of the image.
Coordinates coords() const
Returns the coordinates of the sub-tensor inside the parent tensor.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
ITensorInfo & set_fixed_point_position(int fixed_point_position) override
Set the fixed point position to the specified value.
PaddingSize padding() const override
Padding of tensor.
virtual bool auto_padding()=0
Update the offset to the first element and the strides to automatically computed values.
std::unique_ptr< ITensorInfo > clone() const override
Provide a clone of the current object of class T.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv)
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
virtual ITensorInfo & set_data_layout(const DataLayout &data_layout)=0
Set the data layout of the tensor.
Format
Image colour formats.
ValidRegion valid_region() const override
Valid region of the tensor.
virtual int fixed_point_position() const =0
Fixed point position used when the tensor data type is QS8 or QS16.
~SubTensorInfo()=default
Default destructor.
Format format() const override
Colour format of the image.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
virtual PaddingSize padding() const =0
Padding of tensor.
virtual ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info)=0
Set the quantization settings (scale and offset) of the tensor.
ITensorInfo & reset_padding() override
Resets the padding settings of the tensor.
virtual ITensorInfo & set_data_type(DataType data_type)=0
Set the data type to the specified value.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
Strides of an item in bytes.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
size_t dimension(DataLayoutDimension dimension) const override
Return the size of the requested data layout dimension.
SubTensorInfo()
Default constructor.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
size_t num_dimensions() const override
The number of dimensions of the tensor (rank)
DataType data_type() const override
Data type used for each element of the tensor.
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
size_t num_channels() const override
The number of channels for each tensor element.
bool has_padding() const override
Checks if the tensor has been allocated with padding or not.
size_t total_size() const
Collapses all dimensions to a single linear total size.
Quantization settings (used for QASYMM8 data type)
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
Container for valid region of a window.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
virtual ITensorInfo & set_format(Format format)=0
Set the format of an already initialized tensor.
ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info) override
Set the quantization settings (scale and offset) of the tensor.
DataType
Available data types.
void set_valid_region(const ValidRegion &valid_region) override
Set the valid region of the tensor.
DataLayout
Supported tensor data layouts.
ITensorInfo & set_num_channels(int num_channels) override
Set the number of channels to the specified value.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
virtual bool has_padding() const =0
Checks if the tensor has been allocated with padding or not.
ITensorInfo & set_data_layout(const DataLayout &data_layout) override
Set the data layout of the tensor.
virtual ITensorInfo & set_is_resizable(bool is_resizable)=0
Set the flag whether the tensor size can be changed.
size_t dimension(size_t index) const override
Return the size of the requested dimension.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.