diff options
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h | 12 | ||||
-rw-r--r-- | arm_compute/core/Types.h | 15 |
2 files changed, 19 insertions, 8 deletions
diff --git a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h index 9d7c75179a..0a57a26f17 100644 --- a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h +++ b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h @@ -66,14 +66,14 @@ private: * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void pooling2_f32(const Window &window_input, const Window &window); /** Function to perform 2x2 pooling for float16_t. * * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void pooling2_f16(const Window &window_input, const Window &window); /** Function to perform 2x2 pooling for 8bit fixed point. @@ -95,14 +95,14 @@ private: * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void pooling3_f32(const Window &window_input, const Window &window); /** Function to perform 3x3 pooling. * * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void pooling3_f16(const Window &window_input, const Window &window); /** Function to perform 3x3 pooling for 8bit fixed point. * @@ -123,14 +123,14 @@ private: * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void pooling7_f32(const Window &window_input, const Window &window); /** Function to perform NxN pooling. * * @param[in] window_input Input region on which to execute the kernel. * @param[in] window Output region on which to execute the kernel. */ - template <PoolingType pooling_type> + template <PoolingType pooling_type, bool exclude_padding = false> void poolingN_f32(const Window &window_input, const Window &window); /** Common signature for all the specialised Pooling functions * diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index e567bac860..e8be6127a8 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -545,9 +545,15 @@ public: * @param[in] pool_type Pooling type @ref PoolingType. Defaults to @ref PoolingType::MAX * @param[in] pool_size (Optional) Pooling size, in elements, across x and y. Defaults to 2. * @param[in] pad_stride_info (Optional) Padding and stride information @ref PadStrideInfo + * @param[in] exclude_padding (Optional) Strategy when accounting padding in calculations. + * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area). + * Defaults to false; */ - PoolingLayerInfo(PoolingType pool_type = PoolingType::MAX, unsigned int pool_size = 2, PadStrideInfo pad_stride_info = PadStrideInfo()) - : _pool_type(pool_type), _pool_size(pool_size), _pad_stride_info(pad_stride_info) + PoolingLayerInfo(PoolingType pool_type = PoolingType::MAX, + unsigned int pool_size = 2, + PadStrideInfo pad_stride_info = PadStrideInfo(), + bool exclude_padding = false) + : _pool_type(pool_type), _pool_size(pool_size), _pad_stride_info(pad_stride_info), _exclude_padding(exclude_padding) { } PoolingType pool_type() const @@ -562,11 +568,16 @@ public: { return _pad_stride_info; } + bool exclude_padding() const + { + return _exclude_padding; + } private: PoolingType _pool_type; unsigned int _pool_size; PadStrideInfo _pad_stride_info; + bool _exclude_padding; }; /** ROI Pooling Layer Information class */ |