30 #include "tests/datasets/PoolingLayerDataset.h" 31 #include "tests/datasets/PoolingTypesDataset.h" 32 #include "tests/datasets/ShapeDatasets.h" 37 #include "tests/validation/fixtures/PoolingLayerFixture.h" 48 const auto PoolingLayerDatasetFP =
combine(
combine(
combine(datasets::PoolingTypes(),
framework::dataset::make(
"PoolingSize", { Size2D(2, 2), Size2D(3, 3), Size2D(7, 7), Size2D(3, 7), Size2D(7, 8) })),
49 framework::dataset::make(
"PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) })),
57 const auto PoolingLayerDatasetQASYMM8Small =
combine(
combine(
combine(
framework::dataset::make(
"PoolingType", {
PoolingType::MAX,
PoolingType::AVG }),
framework::dataset::make(
"PoolingSize", { Size2D(2, 2), Size2D(3, 3), Size2D(3, 7), Size2D(7, 7) })),
62 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 65 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1);
66 constexpr AbsoluteTolerance<int8_t> tolerance_qasymm8_s(1);
72 QuantizationInfo(.2f, 10),
73 QuantizationInfo(.1f, 5),
74 QuantizationInfo(2.f, 3)
77 const auto qasymm8_signed_in_qinfo_dataset =
framework::dataset::make(
"InputQuantInfo", { QuantizationInfo(.2f, -10) });
80 QuantizationInfo(.2f, -10),
81 QuantizationInfo(.1f, -5),
82 QuantizationInfo(2.f, -3)
87 framework::dataset::make(
"Shape", { TensorShape{ 2
U, 2
U, 1U }, TensorShape{ 2U, 2U, 4U }, TensorShape{ 3U, 5U, 2U }, TensorShape{ 10U, 20U, 3U } }),
90 framework::dataset::make(
"PadStride", { PadStrideInfo{ 1, 1, 2, 2 }, PadStrideInfo{ 1, 1, 4, 4 }, PadStrideInfo{ 1, 1, 3, 3 }, PadStrideInfo{ 1, 1, 2, 5 } })),
130 framework::dataset::make(
"Expected", {
false,
false,
false,
false,
true,
false,
true,
false,
false})),
139 template <
typename T>
142 template <
typename T>
144 template <
typename T>
147 template <
typename T>
173 pool_data_layout_dataset))
184 pool_data_layout_dataset))
192 pool_data_layout_dataset))
201 pool_data_layout_dataset))
209 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 222 pool_data_layout_dataset))
229 pool_data_layout_dataset))
238 pool_data_layout_dataset))
250 template <
typename T>
251 using NEPoolingLayerQuantizedFixture = PoolingLayerValidationQuantizedFixture<Tensor, Accessor, NEPoolingLayer, T>;
252 template <
typename T>
257 combine(PoolingLayerDatasetQASYMM8Small,
258 framework::dataset::
make("
DataType", DataType::QASYMM8))),
260 qasymm8_in_qinfo_dataset),
261 qasymm8_in_qinfo_dataset))
267 combine(PoolingLayerDatasetQASYMM8Small,
270 qasymm8_in_qinfo_dataset),
271 qasymm8_out_qinfo_dataset))
292 combine(PoolingLayerDatasetQASYMM8Small,
293 framework::dataset::
make("
DataType", DataType::QASYMM8_SIGNED))),
295 qasymm8_signed_in_qinfo_dataset),
296 qasymm8_signed_in_qinfo_dataset))
PoolingLayerValidationQuantizedFixture< Tensor, Accessor, NEPoolingLayer, T, true > NEPoolingLayerQuantizedMixedDataLayoutFixture
RelativeTolerance< float > tolerance_f32(0.001f)
F32 Tolerance value for comparing reference's output against implementation's output for floating poi...
SpecialPoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T > NESpecialPoolingLayerFixture
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Copyright (c) 2017-2022 Arm Limited.
1 channel, 1 F16 per channel
Quantization information.
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(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16), }), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8), TensorInfo(TensorShape(30U, 11U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QSYMM16, QuantizationInfo(1.f/32768.f, 0)), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQRT), })), framework::dataset::make("Expected", { false, true, true, true, false, false, true, true, false })), input_info, output_info, act_info, expected)
Accessor implementation for Tensor objects.
DatasetMode
Possible dataset modes.
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
Pooling Layer Information struct.
Padding and stride information class.
validate(CLAccessor(output_state), expected_output)
Num samples, channels, height, width.
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
PoolingLayerIndicesValidationFixture< Tensor, Accessor, NEPoolingLayer, T > NEPoolingLayerIndicesFixture
PoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T > NEPoolingLayerFixture
Class for specifying the size of an image or rectangle.
Num samples, height, width, channels.
Store the tensor's metadata.
PoolingLayerValidationFixture< Tensor, Accessor, NEPoolingLayer, T, true > NEPoolingLayerMixedDataLayoutFixture
quantized, asymmetric fixed-point 8-bit number signed
RelativeTolerance< half_float::half > tolerance_f16(half(0.2))
F16 Tolerance value for comparing reference's output against implementation's output for floating poi...
zip(zip(framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), }), framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), TensorInfo(TensorShape(2U), 1, DataType::F16), TensorInfo(TensorShape(5U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false}))
TEST_SUITE(QASYMM8_to_F32) FIXTURE_DATA_TEST_CASE(RunSmall
DataType
Available data types.
DataLayout
[DataLayout enum definition]
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info, const ITensorInfo *indices=nullptr)
Static function to check if given info will lead to a valid configuration of NEPoolingLayer.
const auto PoolingLayerIndicesDatasetFPSmall