23.11
|
Go to the documentation of this file.
54 if (output->total_size() != 0)
74 : _input(nullptr), _output(nullptr), _block_shape(), _data_layout(
DataLayout::
UNKNOWN)
88 _block_shape = block_shape;
90 _data_layout =
input->info()->data_layout();
94 INEKernel::configure(win);
128 const size_t channel_id =
id.
z();
129 const size_t in_x =
id.x() * _block_shape + (channel_id / channel_size) % _block_shape;
130 const size_t in_y =
id.y() * _block_shape + (channel_id / channel_size) / _block_shape;
131 const int z = channel_id % channel_size;
148 const size_t channel_id =
id.
x();
149 const size_t in_x =
id.y() * _block_shape + (channel_id / channel_size) % _block_shape;
150 const size_t in_y =
id.z() * _block_shape + (channel_id / channel_size) / _block_shape;
151 const int z = channel_id % channel_size;
@ NCHW
Num samples, channels, height, width.
Class to describe a number of elements in each dimension.
NESpaceToDepthLayerKernel()
Default constructor.
void configure(const ITensor *input, ITensor *output, int32_t block_shape)
Initialise the kernel's inputs and output.
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()
Interface for CPU tensor.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, int32_t block_shape)
Static function to check if given info will lead to a valid configuration of NESpaceToDepthLayerKerne...
Includes all wrapper headers at once.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
constexpr auto data_layout
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#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)
bool slide_window_slice_3D(Window &slice) const
Slide the passed 3D window slice.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Window first_slice_window_3D() const
First 3D slice of the window.
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.
Copyright (c) 2017-2023 Arm Limited.
uint8_t * ptr_to_element(const Coordinates &id) const
Return a pointer to the element at the passed coordinates.
@ UNKNOWN
Unknown CL kernel type.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
TensorShape compute_space_to_depth_shape(const ITensorInfo *input, int32_t block_shape)
Calculate the space to batch output shape of a tensor.
Store the tensor's metadata.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
@ UNKNOWN
Unknown data type.
constexpr const Dimension & x() const
Alias to access the first dimension of the window.
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.
constexpr const Dimension & z() const
Alias to access the third dimension of the window.