23.08
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_SUBTENSORINFO_H
25 #define ARM_COMPUTE_SUBTENSORINFO_H
75 std::unique_ptr<ITensorInfo>
clone()
const override;
128 return _tensor_shape[index];
163 return _tensor_shape;
224 return _valid_region;
249 return _parent->
id();
virtual ITensorInfo & set_format(Format format)=0
Set the format of an already initialized tensor.
~SubTensorInfo()=default
Default destructor.
virtual ValidRegion valid_region() const =0
Valid region of the tensor.
bool lock_paddings() const override
Get the lock paddings flag value.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
ITensorInfo & set_tensor_dims_state(const TensorDimsState &state) override
Set the state for each dimension of the tensor.
SubTensorInfo & operator=(const SubTensorInfo &)=default
Allow instances of this class to be copied.
ITensorInfo & set_lock_paddings(bool flag) override
Set the lock paddings flag of the tensor.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
ITensorInfo & set_data_layout(const DataLayout &data_layout) override
Set the data layout of the tensor.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Quantization information.
virtual ITensorInfo & set_num_channels(int num_channels)=0
Set the number of channels to the specified value.
DataLayout
[DataLayout enum definition]
ITensorInfo::Id id() const override
Get the workload tensor id of the tensor.
Container for 2D border size.
virtual Id id() const =0
Get the workload tensor id of the tensor.
DataLayoutDimension
[DataLayout enum definition]
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.
const Strides & strides_in_bytes() const override
The strides in bytes for accessing each dimension of the tensor.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
virtual int32_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,...
ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info) override
Set the quantization settings (scale and offset) of the tensor.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv)
SubTensorInfo()
Default constructor.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
virtual ITensorInfo & set_data_type(DataType data_type)=0
Set the data type to the specified value.
ITensorInfo & reset_padding() override
Resets the padding settings of the tensor.
virtual bool has_padding() const =0
Checks if the tensor has been allocated with padding or not.
Strides of an item in bytes.
size_t total_size() const override
Returns the total size of the tensor in bytes.
Store the sub tensor's metadata.
virtual bool is_dynamic() const =0
Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/func...
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
bool are_values_constant() const override
Flag indicating whether the values of the tensor are constant, meaning that they can change on kernel...
const TensorDimsState & tensor_dims_state() const override
State of each dimension of the tensor shape.
ValidRegion valid_region() const override
Valid region of the tensor.
virtual ITensorInfo & reset_padding()=0
Resets the padding settings of the tensor.
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
size_t total_size() const
Collapses all dimensions to a single linear total size.
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.
Container for valid region of a window.
int32_t Id
An id that uniquely identifies an ITensorInfo within some domain (e.g.
QuantizationInfo quantization_info() const override
Get the quantization settings (scale and offset) of the tensor.
bool is_dynamic() const override
Flag indicating whether the shape of the tensor is dynamic, meaning that it can change on kernel/func...
size_t element_size() const override
Element size in bytes calculated as data_size() * num_channels()
virtual DataType data_type() const =0
Data type used for each element of the tensor.
ITensorInfo & set_tensor_shape(const TensorShape &shape) override
Set the shape of an already initialized tensor.
virtual ITensorInfo & set_is_resizable(bool is_resizable)=0
Set the flag whether the tensor size can be changed.
virtual ITensorInfo & set_are_values_constant(bool are_values_constant)=0
Set the flag whether the tensor values can change during kernel/function execution.
size_t dimension(DataLayoutDimension dimension) const override
Return the size of the requested data layout dimension.
void set_valid_region(const ValidRegion &valid_region) override
Set the valid region of the tensor.
Format
Image colour formats.
bool extend_padding(const PaddingSize &padding) override
Update the offset to the first element, the strides and the total size.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
size_t num_channels() const override
The number of channels for each tensor element.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
std::vector< int > TensorDimsState
DataLayout data_layout() const override
Get the data layout of the tensor.
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
Copyright (c) 2017-2023 Arm Limited.
virtual bool auto_padding()=0
Update the offset to the first element and the strides to automatically computed values.
Format format() const override
Colour format of the image.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
ITensorInfo & set_is_resizable(bool is_resizable) override
Set the flag whether the tensor size can be changed.
ITensorInfo & set_format(Format format) override
Set the format of an already initialized tensor.
bool has_padding() const override
Checks if the tensor has been allocated with padding or not.
Store the tensor's metadata.
virtual ITensorInfo & set_data_layout(const DataLayout &data_layout)=0
Set the data layout of the tensor.
ITensorInfo & set_num_channels(int num_channels) override
Set the number of channels to the specified value.
std::unique_ptr< ITensorInfo > clone() const override
virtual bool are_values_constant() const =0
Flag indicating whether the values of the tensor are constant, meaning that they can change on kernel...
int32_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,...
ITensorInfo & set_id(ITensorInfo::Id id) override
Set the tensor id.
size_t dimension(size_t index) const override
Return the size of the requested dimension.
virtual Format format() const =0
Colour format of the image.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
ITensorInfo & set_are_values_constant(bool are_values_constant) override
Set the flag whether the tensor values can change during kernel/function execution.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
DataType
Available data types.
Coordinates coords() const
Returns the coordinates of the sub-tensor inside the parent tensor.
virtual ITensorInfo & set_id(ITensorInfo::Id id)=0
Set the tensor id.
virtual ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info)=0
Set the quantization settings (scale and offset) of the tensor.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
PaddingSize padding() const override
Padding of tensor.
virtual PaddingSize padding() const =0
Padding of tensor.