37 : _memory_manager(std::move(memory_manager)), _pooling_layer_kernel(), _border_handler(), _asm_glue(), _is_global_pooling_layer(false), _data_layout(
DataLayout::
NCHW)
50 _asm_glue = std::make_unique<CpuPoolingAssemblyDispatch>(_memory_manager);
51 _asm_glue->configure(
input, output, pool_info);
63 auto k = std::make_unique<kernels::CpuPoolingKernel>();
64 k->configure(
input, output, pool_info, indices);
65 _pooling_layer_kernel = std::move(k);
73 PixelValue zero_value((indices) ? std::numeric_limits<int>::min() : 0.f);
78 auto b = std::make_unique<NEFillBorderKernel>();
79 b->configure(
input, _pooling_layer_kernel->border_size(), border_mode, zero_value);
80 _border_handler = std::move(
b);
105 if(_asm_glue && _asm_glue->is_configured())
107 _asm_glue->run(tensors);
BorderMode
Methods available to handle borders.
Class describing the value of a pixel for any image format.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &pool_info, const ITensorInfo *indices=nullptr)
Static function to check if given info will lead to a valid configuration of CpuPooling.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
virtual void schedule_op(ICPPKernel *kernel, const Hints &hints, const Window &window, ITensorPack &tensors)=0
Runs the kernel in the same thread as the caller synchronously.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &info)
Indicates whether or not this function can be used to process the given parameters.
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const PoolingLayerInfo &pool_info, const ITensorInfo *indices=nullptr)
Static function to check if given info will lead to a valid configuration of CpuPoolingKernel.
#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.
Copyright (c) 2017-2021 Arm Limited.
size_t height
Height of the image region or rectangle.
~CpuPooling()
Default destructor.
void configure(ITensorInfo *src, ITensorInfo *dst, const PoolingLayerInfo &pool_info, ITensorInfo *indices=nullptr)
Set the src and dst tensors.
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Pooling Layer Information struct.
CpuPooling(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
Num samples, channels, height, width.
bool is_data_type_quantized_asymmetric(DataType dt)
Check if a given data type is of asymmetric quantized type.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
size_t width
Width of the image region or rectangle.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
Pixels outside the image are assumed to have the same value as the closest image pixel.
Num samples, height, width, channels.
DataLayout
[DataLayout enum definition]
void run(ITensorPack &tensors) override
Run the kernels contained in the function.
static IScheduler & get()
Access the scheduler singleton.