30 #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" 31 #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h" 36 #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" 48 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(0);
49 constexpr
float tolerance_num = 0.05f;
57 ActivationLayerInfo(),
114 PadStrideInfo(1, 1, 0, 0),
115 PadStrideInfo(1, 1, 0, 0),
116 PadStrideInfo(1, 1, 0, 0),
117 PadStrideInfo(1, 1, 0, 0),
118 PadStrideInfo(1, 1, 0, 0),
119 PadStrideInfo(1, 1, 0, 0),
120 PadStrideInfo(1, 1, 0, 0),
121 PadStrideInfo(1, 1, 0, 0),
122 PadStrideInfo(1, 1, 1, 0),
146 framework::dataset::make(
"Expected", {
false,
false,
false,
false,
false,
false,
false,
false,
true,
true })),
155 template <
typename T>
157 template <
typename T>
166 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
171 ActivationFunctionsDataset))
176 large_depth_multipliers),
180 ActivationFunctionsDataset))
190 ActivationFunctionsDataset))
196 large_depth_multipliers),
200 ActivationFunctionsDataset))
214 ActivationFunctionsDataset))
219 large_depth_multipliers),
223 ActivationFunctionsDataset))
233 ActivationFunctionsDataset))
239 large_depth_multipliers),
243 ActivationFunctionsDataset))
257 ActivationFunctionsDataset))
262 large_depth_multipliers),
266 ActivationFunctionsDataset))
277 ActivationFunctionsDataset))
283 large_depth_multipliers),
287 ActivationFunctionsDataset))
300 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
305 ActivationFunctionsDataset))
310 large_depth_multipliers),
314 ActivationFunctionsDataset))
324 ActivationFunctionsDataset))
330 large_depth_multipliers),
334 ActivationFunctionsDataset))
348 ActivationFunctionsDataset))
363 large_depth_multipliers),
367 ActivationFunctionsDataset))
379 ActivationFunctionsDataset))
385 large_depth_multipliers),
389 ActivationFunctionsDataset))
403 ActivationFunctionsDataset))
408 large_depth_multipliers),
412 ActivationFunctionsDataset))
423 ActivationFunctionsDataset))
429 large_depth_multipliers),
433 ActivationFunctionsDataset))
442 template <typename T>
444 template <typename T>
446 template <typename T>
459 ActivationFunctionsDataset))
461 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
465 large_depth_multipliers),
470 ActivationFunctionsDataset))
472 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
482 ActivationFunctionsDataset))
484 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
488 large_depth_multipliers),
493 ActivationFunctionsDataset))
495 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
507 ActivationFunctionsDataset))
509 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
513 large_depth_multipliers),
518 ActivationFunctionsDataset))
520 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
530 ActivationFunctionsDataset))
532 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
543 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
547 large_depth_multipliers),
552 ActivationFunctionsDataset))
554 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
569 ActivationFunctionsDataset))
571 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
582 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
592 ActivationFunctionsDataset))
594 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
605 framework::dataset::
make("SrcDataType",
DataType::QASYMM8)),
606 framework::dataset::
make("WeightsDataType",
DataType::QSYMM8_PER_CHANNEL)),
610 ActivationFunctionsDataset))
612 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
616 large_depth_multipliers),
622 ActivationFunctionsDataset))
624 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
630 framework::dataset::
make("SrcDataType",
DataType::QASYMM8)),
631 framework::dataset::
make("WeightsDataType",
DataType::QSYMM8_PER_CHANNEL)),
635 ActivationFunctionsDataset))
637 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
641 large_depth_multipliers),
647 ActivationFunctionsDataset))
649 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
657 framework::dataset::
make("SrcDataType",
DataType::QASYMM8)),
658 framework::dataset::
make("WeightsDataType",
DataType::QSYMM8_PER_CHANNEL)),
662 ActivationFunctionsDataset))
664 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
668 large_depth_multipliers),
674 ActivationFunctionsDataset))
676 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
682 framework::dataset::
make("SrcDataType",
DataType::QASYMM8)),
683 framework::dataset::
make("WeightsDataType",
DataType::QSYMM8_PER_CHANNEL)),
687 ActivationFunctionsDataset))
689 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
693 large_depth_multipliers),
699 ActivationFunctionsDataset))
701 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
DepthwiseConvolutionLayerValidationQuantizedFixture< CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true > CLDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture
RelativeTolerance< float > tolerance_f32(0.001f)
F32 Tolerance value for comparing reference's output against implementation's output for floating poi...
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.
Activation Layer Information class.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture< CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t > CLDepthwiseConvolutionLayerQuantizedPerChannelFixture
1 channel, 1 S32 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)
DatasetMode
Possible dataset modes.
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
[CLActivationLayer Test snippet]
quantized, asymmetric fixed-point 8-bit number unsigned
Accessor implementation for CLTensor objects.
TEST_SUITE(U8_to_S8) FIXTURE_DATA_TEST_CASE(RunSmall
validate(CLAccessor(output_state), expected_output)
CLDepthwiseConvolutionLayerQuantizedFixture< uint8_t >
Num samples, channels, height, width.
Function to execute a depthwise convolution.
DepthwiseConvolutionLayerValidationFixture< CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true > CLDepthwiseConvolutionLayerMixedDataLayoutFixture
quantized, symmetric per channel fixed-point 8-bit number
Upper Bounded Rectifier ( )
Num samples, height, width, channels.
Store the tensor's metadata.
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
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...
DepthwiseConvolutionLayerValidationFixture< CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T > CLDepthwiseConvolutionLayerFixture
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 *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, ActivationLayerInfo act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1U, 1U))
Static function to check if given info will lead to a valid configuration of CLDepthwiseConvolutionLa...
FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture< half >, framework::DatasetMode::ALL, combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()), depth_multipliers), framework::dataset::make("DataType", DataType::F16)), framework::dataset::make("DataLayout", DataLayout::NCHW)), ActivationFunctionsDataset))
Basic implementation of the OpenCL tensor interface.