31 #include "tests/datasets/ShapeDatasets.h" 36 #include "tests/validation/fixtures/DeconvolutionLayerFixture.h" 47 constexpr AbsoluteTolerance<float> tolerance_quantized(1.0f);
48 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 49 const RelativeTolerance<half_float::half> tolerance_fp16(
half_float::half(0.2f));
51 constexpr
float tolerance_num = 0.07f;
84 QuantizationInfo(1.f / 255.f, 0),
85 QuantizationInfo(2.f, 0),
90 QuantizationInfo(3.f / 255.f, 0),
91 QuantizationInfo(4.f, 0),
130 PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(1, 1, 0, 0),
132 PadStrideInfo(1, 1, 0, 0),
133 PadStrideInfo(1, 1, 1, 1),
134 PadStrideInfo(1, 1, 0, 0),
139 bool is_valid = bool(
NEDeconvolutionLayer::validate(&input_info.clone()->set_is_resizable(
false), &weights_info.clone()->set_is_resizable(
false), &bias_info.clone()->set_is_resizable(
false), &output_info.clone()->set_is_resizable(
false), pad_info));
145 template <
typename T>
148 template <
typename T>
151 template <
typename T>
154 template <
typename T>
157 template <
typename T>
164 data_layouts_dataset),
174 data_layouts_dataset),
182 data_layouts_dataset),
189 data_layouts_dataset),
198 data_layouts_dataset),
225 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 229 data_layouts_dataset),
239 data_layouts_dataset),
246 data_layouts_dataset),
255 data_layouts_dataset),
267 template <
typename T>
268 using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
270 template <
typename T>
273 template <
typename T>
282 data_layouts_dataset),
283 input_qinfo_dataset),
284 output_qinfo_dataset),
288 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
296 data_layouts_dataset),
297 input_qinfo_dataset),
298 output_qinfo_dataset),
302 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
307 data_layouts_dataset),
308 input_qinfo_dataset),
309 output_qinfo_dataset),
313 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
320 data_layouts_dataset),
321 input_qinfo_dataset),
322 output_qinfo_dataset),
326 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
336 DataType::QASYMM8_SIGNED)),
337 data_layouts_dataset),
338 input_qinfo_dataset),
339 output_qinfo_dataset),
343 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
350 DataType::QASYMM8_SIGNED)),
351 data_layouts_dataset),
352 input_qinfo_dataset),
353 output_qinfo_dataset),
357 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
362 data_layouts_dataset),
363 input_qinfo_dataset),
364 output_qinfo_dataset),
368 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
374 DataType::QASYMM8_SIGNED)),
375 data_layouts_dataset),
376 input_qinfo_dataset),
377 output_qinfo_dataset),
381 validate(
Accessor(_target), _reference, tolerance_quantized, tolerance_num);
DeconvolutionValidationFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3 > NEDeconvolutionLayerFixture3x3
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *output, const PadStrideInfo &info)
Static function to check if given info will lead to a valid configuration of NEDeconvolutionLayer.
half_float::half half
16-bit floating point type
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.
RelativeTolerance< float > tolerance_fp32(0.001f)
Copyright (c) 2017-2021 Arm Limited.
DeconvolutionValidationAsymmFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 9, 9 > NEDeconvolutionLayerAsymmFixture9x9
1 channel, 1 F16 per channel
DeconvolutionValidationFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1 > NEDeconvolutionLayerFixture1x1
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)
DeconvolutionValidationAsymmFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3 > NEDeconvolutionLayerAsymmFixture3x3
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
DeconvolutionValidationQuantizedFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3 > NEDeconvolutionLayerQuantizedFixture3x3
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
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)))
DeconvolutionValidationQuantizedFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1 > NEDeconvolutionLayerQuantizedFixture1x1
Num samples, height, width, channels.
quantized, asymmetric fixed-point 8-bit number signed
DeconvolutionValidationFixture< Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4 > NEDeconvolutionLayerFixture4x4
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)))