38 using namespace misc::shape_calculator;
42 Status
validate_arguments(
const ITensorInfo *
input,
const ITensorInfo *output,
const PoolingLayerInfo &pool_info,
const ITensorInfo *indices)
51 int pool_stride_y = 0;
53 const PadStrideInfo pad_stride_info = pool_info.pad_stride_info;
54 std::tie(pool_stride_x, pool_stride_y) = pad_stride_info.stride();
55 const int pool_size_x = pool_info.pool_size.width;
56 const int pool_size_y = pool_info.pool_size.height;
57 const Size2D
pool_size(pool_size_x, pool_size_y);
61 if(output->total_size() != 0)
72 : _func(nullptr), _input(nullptr), _output(nullptr), _indices(nullptr)
88 _func = &NEMaxUnpoolingLayerKernel::unpooling2<float>;
91 _func = &NEMaxUnpoolingLayerKernel::unpooling2<uint8_t>;
94 _func = &NEMaxUnpoolingLayerKernel::unpooling2<int8_t>;
96 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 98 _func = &NEMaxUnpoolingLayerKernel::unpooling2<float16_t>;
108 INEKernel::configure(window);
110 template <
typename T>
111 void NEMaxUnpoolingLayerKernel::unpooling2(
const Window &
window)
115 auto out_ptr =
reinterpret_cast<T *
>(_output->
buffer());
119 auto vindices =
reinterpret_cast<uint32_t *
>(indices.
ptr());
120 auto vinput =
reinterpret_cast<T *
>(input.
ptr());
121 out_ptr[
id[3] * out_stride_w /
sizeof(T) + *vindices] = *vinput;
140 (this->*_func)(window);
Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size)
const Window & window() const
The maximum window the kernel can be executed on.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED(tensor)
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
1 channel, 1 F32 per channel
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
#define ARM_COMPUTE_ERROR_THROW_ON(status)
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
void configure(const ITensor *input, const ITensor *indices, ITensor *output, const PoolingLayerInfo &pool_info)
Set the input and output tensors.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
1 channel, 1 U32 per channel
TensorShape compute_unpool_shape(const ITensorInfo &input, PoolingLayerInfo pool_info)
Calculate the output unpool shape of a tensor.
quantized, asymmetric fixed-point 8-bit number unsigned
Class to describe a number of elements in each dimension.
virtual uint8_t * buffer() const =0
Interface to be implemented by the child class to return a pointer to CPU memory. ...
static Status validate(const ITensorInfo *input, const ITensorInfo *indices, const ITensorInfo *output, const PoolingLayerInfo &pool_info)
Static function to check if given info will lead to a valid configuration of NEMaxUnpoolingLayerKerne...
Pooling Layer Information struct.
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...
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
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_ON_UNCONFIGURED_KERNEL(k)
NEMaxUnpoolingLayerKernel()
Default constructor.
PoolingType
Available pooling types.
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
Information about executing thread and CPU.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
#define ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c,...)
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const GEMMLowpOutputStageInfo *output_stage)
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
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...
quantized, asymmetric fixed-point 8-bit number signed
virtual const Strides & strides_in_bytes() const =0
The strides in bytes for accessing each dimension of the tensor.
Iterator updated by execute_window_loop for each window element.
Describe a multidimensional execution window.
#define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s)
void run(const Window &window, const ThreadInfo &info) override
Execute the kernel on the passed window.