diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2022-02-15 11:40:13 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2022-03-01 12:46:52 +0000 |
commit | 918a9fb4aa4be23ca4261c241e9e52acc42f9bb3 (patch) | |
tree | 1798ad109145b10e3314dcbbe4fd9339eb21685e /arm_compute/core/Types.h | |
parent | a538ae583c8816f69d05b98c62a9d3092f88f798 (diff) | |
download | ComputeLibrary-918a9fb4aa4be23ca4261c241e9e52acc42f9bb3.tar.gz |
Add Pool3d reference implementation
This patch
- adds the reference implementation for the 3D pooling layer
- supports FP32/FP16 and INT8/UINT8 types
- adds a function to calculate the output shape for 3D pooling
- adds a new type for describing pool 3d info (Pool3DInfo)
Resolves: COMPMID-4659
Change-Id: I22a18fa30625c98fa827ef1b50781db6893ba9c4
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7219
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/Types.h')
-rw-r--r-- | arm_compute/core/Types.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 9615811349..6c49cc35c0 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 Arm Limited. + * Copyright (c) 2016-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -1307,6 +1307,42 @@ private: unsigned int _sampling_ratio; }; +struct Pool3DInfo +{ + Pool3DInfo() = default; + + /** Constructor + * + * @param[in] pool_type Pooling type @ref PoolingType. + * @param[in] pool_size Pooling size, in elements, across x, y and z @ref Size3D + * @param[in] padding Paddings in x, y and z dimensions + * @param[in] strides Strides in x, y and z dimensions @ref Size3D + * @param[in] round_type Dimension rounding type (ceil or floor) + * @param[in] exclude_padding Strategy when accounting padding in calculations. + * True will exclude padding while false will not (Used in AVG/L2 pooling to determine the pooling area). + * @param[in] is_global_pooling Sets the pool size to the input size if True + */ + Pool3DInfo(const PoolingType pool_type, + const Size3D pool_size, + const Padding3D padding, + const Size3D strides, + const DimensionRoundingType round_type, + bool exclude_padding, + bool is_global_pooling) + : pool_type(pool_type), pool_size(pool_size), padding(padding), strides(strides), round_type(round_type), exclude_padding(exclude_padding), is_global_pooling(is_global_pooling) + + { + } + + PoolingType pool_type{ PoolingType::MAX }; + Size3D pool_size{ 1U, 1U, 1U }; + Padding3D padding{}; + Size3D strides{ 1U, 1U, 1U }; + DimensionRoundingType round_type{ DimensionRoundingType::FLOOR }; + bool exclude_padding{ false }; + bool is_global_pooling{ false }; +}; + /** Generate Proposals Information class */ class GenerateProposalsInfo { |