Compute Library
 22.05
PoolingLayer.cpp File Reference
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/NEON/functions/NEPoolingLayer.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "tests/NEON/Accessor.h"
#include "tests/PaddingCalculator.h"
#include "tests/datasets/PoolingLayerDataset.h"
#include "tests/datasets/PoolingTypesDataset.h"
#include "tests/datasets/ShapeDatasets.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Macros.h"
#include "tests/framework/datasets/Datasets.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/PoolingLayerFixture.h"

Go to the source code of this file.

Namespaces

 arm_compute
 Copyright (c) 2017-2022 Arm Limited.
 
 arm_compute::test
 
 arm_compute::test::validation
 

Typedefs

template<typename T >
using NEPoolingLayerIndicesFixture = PoolingLayerIndicesValidationFixture< Tensor, Accessor, NEPoolingLayer, T >
 
template<typename T >
using NEPoolingLayerFixture = PoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T >
 
template<typename T >
using NEPoolingLayerMixedDataLayoutFixture = PoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T, true >
 
template<typename T >
using NESpecialPoolingLayerFixture = SpecialPoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T >
 
template<typename T >
using NEPoolingLayerQuantizedMixedDataLayoutFixture = PoolingLayerValidationQuantizedFixture< Tensor, Accessor, NEPoolingLayer, T, true >
 

Functions

 DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(15U, 13U, 5U), 1, DataType::F32), TensorInfo(TensorShape(13U, 13U, 5U), 1, DataType::F32), TensorInfo(TensorShape(13U, 13U, 5U), 1, DataType::QASYMM8), TensorInfo(TensorShape(13U, 13U, 5U), 1, DataType::F32), TensorInfo(TensorShape(1U, 16U, 1U), 1, DataType::F32), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(25U, 16U, 2U), 1, DataType::F32), TensorInfo(TensorShape(1U, 1U, 5U), 1, DataType::F32), TensorInfo(TensorShape(2U, 2U, 5U), 1, DataType::F32), TensorInfo(TensorShape(12U, 12U, 5U), 1, DataType::QASYMM8), TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(1U, 15U, 1U), 1, DataType::F32), })), framework::dataset::make("PoolInfo", { PoolingLayerInfo(PoolingType::AVG, 3, DataLayout::NCHW, PadStrideInfo(1, 1, 0, 0)), PoolingLayerInfo(PoolingType::AVG, 3, DataLayout::NCHW, PadStrideInfo(1, 1, 0, 0)), PoolingLayerInfo(PoolingType::AVG, 2, DataLayout::NCHW, PadStrideInfo(1, 1, 2, 0)), PoolingLayerInfo(PoolingType::AVG, 2, DataLayout::NCHW, PadStrideInfo(1, 1, 0, 2)), PoolingLayerInfo(PoolingType::AVG, DataLayout::NCHW), PoolingLayerInfo(PoolingType::MAX, DataLayout::NCHW), PoolingLayerInfo(PoolingType::AVG, 2, DataLayout::NHWC, PadStrideInfo(), false), PoolingLayerInfo(PoolingType::AVG, DataLayout::NCHW), PoolingLayerInfo(PoolingType::MAX, 2, DataLayout::NHWC, PadStrideInfo(1, 1, 0, 0), false), })), framework::dataset::make("Expected", { false, false, false, false, true, false, true, false, false})), input_info, output_info, pool_info, expected)
 
 FIXTURE_DATA_TEST_CASE (RunIndices, NEPoolingLayerIndicesFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallNoneUnitShapes(), combine(PoolingLayerIndicesDatasetFPSmall, framework::dataset::make("DataType", DataType::F32))), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
 
 FIXTURE_DATA_TEST_CASE (RunSpecial, NESpecialPoolingLayerFixture< float >, framework::DatasetMode::ALL, datasets::PoolingLayerDatasetSpecial() *framework::dataset::make("DataType", DataType::F32))
 
 FIXTURE_DATA_TEST_CASE (RunSmall, NEPoolingLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallNoneUnitShapes(), combine(PoolingLayerDatasetFPSmall, framework::dataset::make("DataType", DataType::F32))), pool_data_layout_dataset))
 
 FIXTURE_DATA_TEST_CASE (RunMixedDataLayout, NEPoolingLayerMixedDataLayoutFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallNoneUnitShapes(), combine(combine(combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { Size2D(2, 2) })), framework::dataset::make("PadStride", { PadStrideInfo(2, 1, 0, 0) })), framework::dataset::make("ExcludePadding", { false })), framework::dataset::make("DataType", DataType::F32))), pool_data_layout_dataset))
 
 FIXTURE_DATA_TEST_CASE (RunLarge, NEPoolingLayerFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType", DataType::F32))), pool_data_layout_dataset))
 
 FIXTURE_DATA_TEST_CASE (PoolRegionCompletelyOutsideInput, NEPoolingLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(pool_outside_input_dataset, framework::dataset::make("DataType", DataType::F32)), pool_data_layout_dataset))
 
 TEST_SUITE_END () FIXTURE_DATA_TEST_CASE(RunSmall = ActivationValidationQuantizedFixture<CLTensor, CLAccessor, CLActivationLayer, T>
 [CLActivationLayer Test snippet] More...
 
 FIXTURE_DATA_TEST_CASE (RunSmallNCHW, NEPoolingLayerQuantizedFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallNoneUnitShapes(), combine(PoolingLayerDatasetQASYMM8Small, framework::dataset::make("DataType", DataType::QASYMM8))), framework::dataset::make("DataLayout", { DataLayout::NCHW })), qasymm8_in_qinfo_dataset), qasymm8_in_qinfo_dataset))
 
 FIXTURE_DATA_TEST_CASE (RunSmall, NEPoolingLayerQuantizedFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallNoneUnitShapes(), combine(PoolingLayerDatasetQASYMM8Small, framework::dataset::make("DataType", DataType::QASYMM8))), framework::dataset::make("DataLayout", { DataLayout::NHWC })), qasymm8_in_qinfo_dataset), qasymm8_out_qinfo_dataset))
 
 FIXTURE_DATA_TEST_CASE (RunMixedDataLayout, NEPoolingLayerQuantizedMixedDataLayoutFixture< uint8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallNoneUnitShapes(), combine(combine(combine(combine(framework::dataset::make("PoolingType", { PoolingType::MAX, PoolingType::AVG }), framework::dataset::make("PoolingSize", { Size2D(2, 2) })), framework::dataset::make("PadStride", { PadStrideInfo(1, 2, 1, 1) })), framework::dataset::make("ExcludePadding", { true })), framework::dataset::make("DataType", DataType::QASYMM8))), framework::dataset::make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW })), framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f/255.f, 10) })), framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f/255.f, 5) })))
 
 combine (combine(combine(combine(datasets::SmallNoneUnitShapes(), combine(PoolingLayerDatasetQASYMM8Small, framework::dataset::make("DataType", DataType::QASYMM8_SIGNED))), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), qasymm8_signed_in_qinfo_dataset), qasymm8_signed_in_qinfo_dataset))
 
 FIXTURE_DATA_TEST_CASE (RunMixedDataLayout, NEPoolingLayerQuantizedMixedDataLayoutFixture< int8_t >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallNoneUnitShapes(), combine(combine(combine(combine(framework::dataset::make("PoolingType", { PoolingType::MAX, PoolingType::AVG }), framework::dataset::make("PoolingSize", { Size2D(2, 2) })), framework::dataset::make("PadStride", { PadStrideInfo(1, 2, 1, 1) })), framework::dataset::make("ExcludePadding", { true })), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED))), framework::dataset::make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW })), framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f/127.f, -10) })), framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f/127.f, -10) })))
 

Variables

 NEPoolingLayerQuantizedFixture< int8_t >