24 #ifndef ARM_COMPUTE_TENSORINFO_H 25 #define ARM_COMPUTE_TENSORINFO_H 178 void init(
const TensorShape &tensor_shape,
size_t num_channels,
DataType data_type,
const Strides &strides_in_bytes,
size_t offset_first_element_in_bytes,
179 size_t total_size_in_bytes);
186 void init(
const HOGInfo &hog_info,
unsigned int width,
unsigned int height);
222 std::unique_ptr<ITensorInfo>
clone()
const override;
235 return _tensor_shape[index];
243 return _strides_in_bytes;
247 return _offset_first_element_in_bytes;
260 return _num_channels;
264 return _tensor_shape;
288 return !_padding.
empty();
292 return _is_resizable;
296 return std::find(std::cbegin(_dims_state), std::cend(_dims_state), -1) != std::cend(_dims_state);
305 return _valid_region;
313 return _quantization_info;
325 std::tuple<Strides, size_t, size_t> calculate_padding_requirements(
const PaddingSize &padding);
328 size_t _offset_first_element_in_bytes;
330 size_t _num_channels;
ITensorInfo & set_format(Format format) override
Set the format of an already initialized tensor.
size_t init_auto_padding(const TensorShape &tensor_shape, Format format)
Initialize the metadata structure for the given tensor shape and single-plane format, (Padding is automatically calculated)
bool has_padding() const override
Checks if the tensor has been allocated with padding or not.
void set_valid_region(const ValidRegion &valid_region) override
Set the valid region of the tensor.
std::unique_ptr< ITensorInfo > clone() const override
Provide a clone of the current object of class T.
bool is_resizable() const override
Flag indicating whether the size of the tensor can be changed.
Container for 2D border size.
ValidRegion valid_region() const override
Valid region of the tensor.
size_t num_channels() const override
The number of channels for each tensor element.
ITensorInfo & reset_padding() override
Resets the padding settings 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...
DataLayout data_layout() const override
Get the data layout of the tensor.
DataLayoutDimension
[DataLayout enum definition]
size_t dimension(size_t index) const override
Return the size of the requested dimension.
Store the HOG's metadata.
QuantizationInfo quantization_info() const override
Get the quantization settings (scale and offset) of the tensor.
bool extend_padding(const PaddingSize &padding) override
Update the offset to the first element, the strides and the total size.
ITensorInfo & set_data_type(DataType data_type) override
Set the data type to the specified value.
Store the tensor's metadata.
size_t dimension(DataLayoutDimension dimension) const override
Return the size of the requested data layout dimension.
PaddingSize padding() const override
Padding of tensor.
const Strides & strides_in_bytes() const override
The strides in bytes for accessing each dimension of the tensor.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
Copyright (c) 2017-2021 Arm Limited.
Format format() const override
Colour format of the image.
ITensorInfo & set_quantization_info(const QuantizationInfo &quantization_info) override
Set the quantization settings (scale and offset) of the tensor.
DataType data_type() const override
Data type used for each element of the tensor.
Quantization information.
size_t num_dimensions() const override
The number of dimensions of the tensor (rank)
ITensorInfo & set_data_layout(const DataLayout &data_layout) override
Set the data layout of the tensor.
Format
Image colour formats.
size_t total_size() const override
Returns the total size of the tensor in bytes.
const TensorDimsState & tensor_dims_state() const override
State of each dimension of the tensor shape.
size_t data_size_from_type(DataType data_type)
The size in bytes of the data type.
ITensorInfo & set_is_resizable(bool is_resizable) override
Set the flag whether the tensor size can be changed.
ITensorInfo & set_num_channels(int num_channels) override
Set the number of channels to the specified value.
void init(Format format)
Initialize the tensor info with just a format.
Strides of an item in bytes.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
ITensorInfo & set_tensor_dims_state(const TensorDimsState &state) override
Set the state for each dimension of the tensor.
constexpr bool empty() const
Check if the entire border is zero.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
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...
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...
Store the tensor's metadata.
ITensorInfo & set_tensor_shape(const TensorShape &shape) override
Set the shape of an already initialized tensor.
TensorInfo()
Default constructor.
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.
TensorInfo & operator=(const TensorInfo &)=default
Allow instances of this class to be copied.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
DataType
Available data types.
DataLayout
[DataLayout enum definition]
size_t element_size() const override
Element size in bytes calculated as data_size() * num_channels()
~TensorInfo()=default
Default destructor.