24 #ifndef __ARM_COMPUTE_TENSORINFO_H__ 25 #define __ARM_COMPUTE_TENSORINFO_H__ 119 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,
127 void init(
const HOGInfo &hog_info,
unsigned int width,
unsigned int height);
192 return _tensor_shape[index];
200 return _strides_in_bytes;
209 return _offset_first_element_in_bytes;
225 return _fixed_point_pos;
249 return _num_channels;
257 return _tensor_shape;
297 return _is_resizable;
310 return _valid_region;
315 _valid_region = std::move(valid_region);
323 std::tuple<Strides, size_t, size_t> calculate_padding_requirements(
const PaddingSize &padding);
326 size_t _fixed_point_pos;
327 size_t _offset_first_element_in_bytes;
329 size_t _num_channels;
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)
DataType data_type() const
Data type used for each element of the tensor.
bool auto_padding()
Update the offset to the first element and the strides to automatically computed values.
Container for 2D border size.
void set_is_resizable(bool is_resizable)
Set the flag whether the tensor size can be changed.
Store the HOG's metadata.
size_t element_size() const
Element size in bytes calculated as data_size() * num_channels.
size_t offset_element_in_bytes(const Coordinates &pos) const
The offset in bytes from the beginning of the memory allocation to access the element at position (x...
virtual ~TensorInfo()=default
Default destructor.
size_t num_channels() const
The number of channels for each tensor element.
void init(const TensorShape &tensor_shape, Format format)
Initialize the metadata structure with the given parameters.
size_t dimension(size_t index) const
Return the size of the requested dimension.
Format
Image colour formats.
const TensorShape & tensor_shape() const
Size for each dimension of the tensor.
size_t data_size_from_type(DataType data_type)
The size in bytes of the data type.
void set_valid_region(ValidRegion valid_region)
Set the valid region of the tensor.
size_t total_size() const
Returns the total size of the tensor in bytes.
Strides of an item in bytes.
void set_format(Format format)
Set the format of an already initialized tensor.
ValidRegion valid_region() const
Valid region of the tensor.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
bool extend_padding(const PaddingSize &padding)
Update the offset to the first element, the strides and the total size.
size_t offset_first_element_in_bytes() const
The offset from the beginning of the memory allocation to the first element of the tensor...
Format format() const
Colour format of the image.
Store the tensor's metadata.
TensorInfo()
Default constructor.
TensorInfo & operator=(const TensorInfo &)=default
Allow instances of this class to be copied.
const Strides & strides_in_bytes() const
The strides in bytes for accessing each dimension of the tensor.
DataType
Available data types.
size_t fixed_point_pos() const
Fixed point position used when the tensor data type is S8, S16 or S32.
bool has_padding()
Checks if the tensor has been allocated with padding or not.
size_t num_dimensions() const
The number of dimensions of the tensor (rank)
bool is_resizable()
Flag indicating whether the size of the tensor can be changed.