66 for(
unsigned int i = 0; i <
id.num_dimensions(); ++i)
68 offset.
set(i, starts[i] +
id[i]);
70 *
reinterpret_cast<T *
>(
dst(
id)) = *reinterpret_cast<const T *>(
src(offset));
82 int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
110 starts, ends, strides,
111 begin_mask, end_mask, shrink_axis_mask);
114 unsigned int idx = 0;
117 starts, ends, strides,
118 begin_mask, end_mask, shrink_axis_mask,
true));
122 for(
unsigned int i = 0; i <
id.num_dimensions(); ++i)
124 offset.
set(i, starts_abs[i] +
id[i] * final_strides[i]);
126 dst.data()[idx++] = *
reinterpret_cast<const T *
>(
src(offset));
134 int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask);
137 int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask);
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
TensorShape compute_slice_shape(const TensorShape &input_shape, const Coordinates &starts, const Coordinates &ends)
Calculate the slice output shape of a tensor.
DataType data_type() const override
Data type of the tensor.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
TensorShape shape() const override
Shape of the tensor.
void use_tensor_dimensions(const TensorShape &shape, size_t first_dimension=Window::DimX)
Use the tensor's dimensions to fill the window dimensions.
SimpleTensor< float > src
Copyright (c) 2017-2023 Arm Limited.
SimpleTensor< T > strided_slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends, BiStrides strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
Simple tensor object that stores elements in a consecutive chunk of memory.
std::array< T, num_max_dimensions >::const_iterator cbegin() const
Returns a read-only (constant) iterator that points to the first element in the dimension array...
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
void execute_window_loop(const Window &w, L &&lambda_function, Ts &&... iterators)
Iterate through the passed window, automatically adjusting the iterators and calling the lambda_funct...
Describe a multidimensional execution window.
SimpleTensor< T > slice(const SimpleTensor< T > &src, Coordinates starts, Coordinates ends)