23.11
|
Go to the documentation of this file.
24 #ifndef SRC_CORE_HELPERS_AUTOCONFIGURATION_H
25 #define SRC_CORE_HELPERS_AUTOCONFIGURATION_H
49 if (
info.tensor_shape().total_size() == 0)
52 info.set_num_channels(num_channels);
54 info.set_quantization_info(quantization_info);
97 if (
info.tensor_shape().total_size() == 0)
118 info.set_format(format);
175 info.set_quantization_info(quantization_info);
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
virtual size_t num_channels() const =0
The number of channels for each tensor element.
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]
bool set_data_type_if_unknown(ITensorInfo &info, DataType data_type)
Set the data type and number of channels to the specified value if the current data type is unknown.
virtual ITensorInfo & set_tensor_shape(const TensorShape &shape)=0
Set the shape of an already initialized tensor.
virtual ITensorInfo & set_data_type(DataType data_type)=0
Set the data type to the specified value.
constexpr auto data_layout
DataLayout data_layout
Data layout to use.
bool set_data_layout_if_unknown(ITensorInfo &info, DataLayout data_layout)
Set the data layout to the specified value if the current data layout is unknown.
bool set_quantization_info_if_empty(ITensorInfo &info, QuantizationInfo quantization_info)
Set the quantization info to the specified value if the current quantization info is empty and the da...
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
size_t total_size() const
Collapses all dimensions to a single linear total size.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
virtual ITensorInfo & set_are_values_constant(bool are_values_constant)=0
Set the flag whether the tensor values can change during kernel/function execution.
Format
Image colour formats.
virtual QuantizationInfo quantization_info() const =0
Get the quantization settings (scale and offset) of the tensor.
bool set_shape_if_empty(ITensorInfo &info, const TensorShape &shape)
Set the shape to the specified value if the current assignment is empty.
Copyright (c) 2017-2023 Arm Limited.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
virtual ITensorInfo & set_data_layout(const DataLayout &data_layout)=0
Set the data layout of the tensor.
bool set_format_if_unknown(ITensorInfo &info, Format format)
Set the format, data type and number of channels to the specified value if the current data type is u...
virtual bool are_values_constant() const =0
Flag indicating whether the values of the tensor are constant, meaning that they can change on kernel...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
DataType
Available data types.
virtual ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info)=0
Set the quantization settings (scale and offset) of the tensor.