24.04
|
Go to the documentation of this file.
55 "The width of the input tensor must be a multiple of stride");
57 "The height of the input tensor must be a multiple of stride");
60 if (output->total_size() != 0)
62 const TensorInfo tensor_info_output =
96 ICPPKernel::configure(win);
116 const unsigned int stride = _stride;
117 const unsigned int out_c = _output->
info()->
tensor_shape()[idx_c] / (stride * stride);
118 const uint8_t *in_ptr = _input->
buffer();
124 Iterator out(_output, collapsed_window);
132 const unsigned int w =
id[idx_w];
133 const unsigned int h =
id[idx_h];
134 const unsigned int c =
id[idx_c];
137 const unsigned int offset = c / out_c;
139 map_coords.
set(idx_w,
w * stride +
offset % stride);
140 map_coords.
set(idx_h, h * stride +
offset / stride);
141 map_coords.
set(idx_c, c % out_c);
Class to describe a number of elements in each dimension.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
DataLayout
[DataLayout enum definition]
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
Status validate_arguments(const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *dst, const PadStrideInfo &conv_info)
#define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k)
virtual size_t element_size() const =0
Element size in bytes calculated as data_size() * num_channels()
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
virtual int32_t offset_element_in_bytes(const Coordinates &pos) const =0
The offset in bytes from the beginning of the memory allocation to access the element at position (x,...
Window collapse_if_possible(const Window &full_window, size_t first, size_t last, bool *has_collapsed=nullptr) const
Collapse the dimensions between first and last if possible.
Interface for CPU tensor.
NEReorgLayerKernel()
Default constructor.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
constexpr auto data_layout
TensorShape compute_reorg_output_shape(const ITensorInfo &input, int32_t stride)
Calculate the output shape of the reorg layer given a stride.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, int32_t stride)
Static function to check if given info will lead to a valid configuration.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
constexpr uint8_t * ptr() const
Return a pointer to the current pixel.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
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...
Iterator updated by execute_window_loop for each window element.
#define ARM_COMPUTE_RETURN_ERROR_ON(cond)
If the condition is true, an error is returned.
bool auto_init_if_empty(ITensorInfo &info, const TensorShape &shape, int num_channels, DataType data_type, QuantizationInfo quantization_info=QuantizationInfo())
Auto initialize the tensor info (shape, number of channels and data type) if the current assignment i...
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
const Window & window() const
The maximum window the kernel can be executed on.
Information about executing thread and CPU.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
Describe a multidimensional execution window.
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Copyright (c) 2017-2024 Arm Limited.
@ UNKNOWN
Unknown data layout.
Store the tensor's metadata.
void configure(const ITensor *input, ITensor *output, int32_t stride)
Set the input and output of the kernel.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory.