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)
119 framework::dataset::make(
"Expected", {
false,
false,
false,
false,
true,
false,
false,
false,
true })),
128 template <
typename T>
131 template <
typename T>
134 template <
typename T>
163 pool_data_layout_dataset))
171 pool_data_layout_dataset))
178 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 182 pool_data_layout_dataset))
189 pool_data_layout_dataset))
200 template <
typename T>
201 using NEPoolingLayerQuantizedFixture = PoolingLayerValidationQuantizedFixture<Tensor, Accessor, NEPoolingLayer, T>;
205 combine(PoolingLayerDatasetQASYMM8Small,
206 framework::dataset::
make("
DataType", DataType::QASYMM8))),
208 qasymm8_in_qinfo_dataset),
209 qasymm8_in_qinfo_dataset))
215 combine(PoolingLayerDatasetQASYMM8Small,
218 qasymm8_in_qinfo_dataset),
219 qasymm8_out_qinfo_dataset))
227 combine(PoolingLayerDatasetQASYMM8Small,
228 framework::dataset::
make("
DataType", DataType::QASYMM8_SIGNED))),
230 qasymm8_signed_in_qinfo_dataset),
231 qasymm8_signed_in_qinfo_dataset))
237 combine(PoolingLayerDatasetQASYMM8Small,
240 qasymm8_signed_in_qinfo_dataset),
241 qasymm8_signed_out_qinfo_dataset))
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-2021 Arm Limited.
1 channel, 1 F16 per channel
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.
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
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
NEPoolingLayerQuantizedFixture< int8_t >
Class for specifying the size of an image or rectangle.
Num samples, height, width, channels.
Store the tensor's metadata.
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}))
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