23.11
|
Go to the documentation of this file.
42 TensorShape extend_parent_shape(TensorShape parent_shape, TensorShape
shape, Coordinates coords)
47 int dimension_extend = coords[i] +
static_cast<int>(
shape[i]);
48 if ((dimension_extend >
static_cast<int>(parent_shape[i])) && (dimension_extend > 0))
50 parent_shape.set(i,
static_cast<size_t>(dimension_extend));
64 _extend_parent(
false),
71 _tensor_shape(tensor_shape),
75 _extend_parent(extend_parent),
81 if (parent->tensor_shape().total_size() != 0 && !_extend_parent)
87 _valid_region = ValidRegion{Coordinates(), _tensor_shape};
95 auto clone_obj = _parent->
clone();
96 clone_obj->set_tensor_shape(_tensor_shape);
97 clone_obj->set_valid_region(_valid_region);
111 else if (_extend_parent)
118 _tensor_shape =
shape;
131 _lock_paddings = flag;
137 return _lock_paddings;
170 offset += pos[i] * strides[i];
unsigned int right
right of the border
bool lock_paddings() const override
Get the lock paddings flag value.
ITensorInfo & set_tensor_dims_state(const TensorDimsState &state) override
Set the state for each dimension of the tensor.
ITensorInfo & set_lock_paddings(bool flag) override
Set the lock paddings flag of the tensor.
@ UNKNOWN
Unknown image format.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Container for 2D border size.
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 bool extend_padding(const PaddingSize &padding)=0
Update the offset to the first element, the strides and the total size.
const Strides & strides_in_bytes() const override
The strides in bytes for accessing each dimension of the tensor.
virtual ITensorInfo & set_tensor_shape(const TensorShape &shape)=0
Set the shape of an already initialized tensor.
unsigned int top
top of the border
SubTensorInfo()
Default constructor.
Strides of an item in bytes.
#define ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md)
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
unsigned int bottom
bottom of the border
size_t total_size() const
Collapses all dimensions to a single linear total size.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR(p, c, s)
Container for valid region of a window.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
ITensorInfo & set_tensor_shape(const TensorShape &shape) override
Set the shape of an already initialized tensor.
T x() const
Alias to access the size of the first dimension.
bool extend_padding(const PaddingSize &padding) override
Update the offset to the first element, the strides and the total size.
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
virtual bool is_resizable() const =0
Flag indicating whether the size of the tensor can be changed.
Copyright (c) 2017-2023 Arm Limited.
virtual void set_valid_region(const ValidRegion &valid_region)=0
Set the valid region of the tensor.
unsigned int left
left of the border
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
Store the tensor's metadata.
std::unique_ptr< ITensorInfo > clone() const override
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,...
@ UNKNOWN
Unknown data type.
virtual Format format() const =0
Colour format of the image.
T y() const
Alias to access the size of the second dimension.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
virtual size_t total_size() const =0
Returns the total size of the tensor in bytes.
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
PaddingSize padding() const override
Padding of tensor.