23.11
|
Go to the documentation of this file.
43 anchor[0] + border_size.
left,
46 anchor[0] + border_size.
left +
48 static_cast<int>(border_size.
right)),
59 anchor[1] + border_size.
top,
61 anchor[1] + border_size.
top +
63 static_cast<int>(border_size.
bottom)),
106 static_cast<int>(border_size.
right)),
112 if (
shape.num_dimensions() > 1)
119 static_cast<int>(border_size.
top) -
120 static_cast<int>(border_size.
bottom)),
127 if (
shape.num_dimensions() > 2)
134 for (; n <
shape.num_dimensions(); ++n)
156 anchor[0] - border_size.
left,
159 anchor[0] - border_size.
left +
169 anchor[1] - border_size.
top,
171 anchor[1] - border_size.
top +
210 border_size.
left = 0;
211 border_size.
right = 0;
221 anchor[0] + border_size.
left,
224 anchor[0] + border_size.
left +
226 static_cast<int>(border_size.
right)),
236 anchor[1] - border_size.
top,
271 for (; dim < num_dimensions; ++dim)
273 if (shape0[dim] != shape1[dim] || strides0[dim] != squashed_bytes || strides1[dim] != squashed_bytes)
278 squashed_bytes *= shape0[dim];
281 if (dim == num_dimensions)
283 auto squashed_elements = squashed_bytes / src0.
element_size();
304 return std::make_pair(win, split_dimension);
309 const auto &
shape =
src.tensor_shape();
310 const auto &strides =
src.strides_in_bytes();
311 const auto num_dimensions =
src.num_dimensions();
316 size_t squashed_bytes =
src.element_size();
319 for (; dim < num_dimensions; ++dim)
321 if (strides[dim] != squashed_bytes)
325 squashed_bytes *=
shape[dim];
327 if (dim == num_dimensions)
329 const auto squashed_elements = squashed_bytes /
src.element_size();
346 return std::make_pair(win, split_dimension);
Class to describe a number of elements in each dimension.
unsigned int right
right of the border
SimpleTensor< float > src
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Container for 2D border size.
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
unsigned int top
top of the border
const ValidRegion valid_region
unsigned int bottom
bottom of the border
Window calculate_max_window_horizontal(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Container for valid region of a window.
Describe one of the image's dimensions with a start, end and step.
void set(size_t dimension, const Dimension &dim)
Set the values of a given dimension.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
auto ceil_to_multiple(S value, T divisor) -> decltype(((value+divisor - 1)/divisor) *divisor)
Computes the smallest number larger or equal to value that is a multiple of divisor.
Describe a multidimensional execution window.
TensorShape shape
Shape of the valid region.
std::pair< Window, size_t > calculate_squashed_or_max_window(const ITensorInfo &src0, const ITensorInfo &src1)
Copyright (c) 2017-2023 Arm Limited.
unsigned int left
left of the border
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
Store the tensor's metadata.
Window calculate_max_enlarged_window(const ValidRegion &valid_region, const Steps &steps, BorderSize border_size)
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
static constexpr size_t num_max_dimensions
Number of dimensions the tensor has.
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
Coordinates anchor
Anchor for the start of the valid region.