33 #include "tests/datasets/ActivationFunctionsDataset.h"
34 #include "tests/datasets/LargeConvolutionLayerDataset.h"
35 #include "tests/datasets/ShapeDatasets.h"
36 #include "tests/datasets/SmallConvolutionLayerDataset.h"
37 #include "tests/datasets/WinogradInputTransformDataset.h"
38 #include "tests/datasets/WinogradOutputTransformDataset.h"
43 #include "tests/validation/fixtures/WinogradConvolutionLayerFixture.h"
57 constexpr AbsoluteTolerance<float> tolerance_convolution_layer_f32(0.1f);
58 const AbsoluteTolerance<half> tolerance_convolution_layer_f16(
half(0.4f));
59 RelativeTolerance<half_float::half> rel_tolerance_f16(
half(0.2));
61 constexpr
float abs_tolerance_convolution_layer_f16 = 2.5f;
66 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU),
67 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.8f),
68 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU, 0.1f),
69 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU),
70 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ELU),
71 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS),
72 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC),
73 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH),
74 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQUARE),
75 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::HARD_SWISH),
76 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR, 2.f, 1.f),
77 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::GELU)
80 const auto ActivationFunctionsSmallDataset =
make(
"ActivationInfo",
82 ActivationLayerInfo(),
83 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.8f, -0.5f)
118 make(
"WeightsInfo", {
135 TensorInfo(TensorShape(21U, 25U, 21U, 4U), 1,
DataType::F32),
140 PadStrideInfo(1, 1, 1, 1),
141 PadStrideInfo(1, 1, 1, 1),
142 PadStrideInfo(1, 2, 0, 0),
143 PadStrideInfo(1, 1, 1, 1),
144 PadStrideInfo(1, 1, 1, 0)
146 make(
"Expected", {
false,
false,
false,
false,
false })),
153 make(
"WeightsInfo", {
248 ActivationLayerInfo(),
259 combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(),
261 ActivationFunctionsSmallDataset,
265 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
268 combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(),
274 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
290 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
296 combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(),
298 ActivationFunctionsSmallDataset,
302 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
306 combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(),
312 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
318 combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(),
320 ActivationFunctionsSmallDataset,
324 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
336 ActivationFunctionsSmallDataset,
340 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
344 combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(),
350 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
356 combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(),
358 ActivationFunctionsSmallDataset,
363 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
367 combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(),
374 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
390 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
396 combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(),
398 ActivationFunctionsSmallDataset,
403 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
407 combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(),
414 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
420 combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(),
422 ActivationFunctionsSmallDataset,
427 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
431 combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(),
438 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
444 combine(datasets::SmallWinogradConvolutionLayer1x7Dataset(),
446 ActivationFunctionsSmallDataset,
451 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
467 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
473 combine(datasets::SmallWinogradConvolutionLayer7x1Dataset(),
475 ActivationFunctionsSmallDataset,
480 validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
496 combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(),
498 ActivationFunctionsSmallDataset,
506 combine(datasets::LargeWinogradConvolutionLayer3x3DatasetFp16Subset(),
512 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
528 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
534 combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(),
536 ActivationFunctionsSmallDataset,
544 combine(datasets::LargeWinogradConvolutionLayer3x1DatasetFp16Subset(),
550 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
556 combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(),
558 ActivationFunctionsSmallDataset,
566 combine(datasets::LargeWinogradConvolutionLayer1x3DatasetFp16Subset(),
572 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
578 combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(),
580 ActivationFunctionsSmallDataset,
589 combine(datasets::LargeWinogradConvolutionLayer5x5DatasetFp16Subset(),
596 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
612 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
618 combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(),
620 ActivationFunctionsSmallDataset,
629 combine(datasets::LargeWinogradConvolutionLayer5x1DatasetFp16Subset(),
636 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
642 combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(),
644 ActivationFunctionsSmallDataset,
653 combine(datasets::LargeWinogradConvolutionLayer1x5DatasetFp16Subset(),
660 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
666 combine(datasets::SmallWinogradConvolutionLayer1x7Dataset(),
668 ActivationFunctionsSmallDataset,
677 combine(datasets::LargeWinogradConvolutionLayer1x7DatasetFp16Subset(),
684 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
700 validate(CLAccessor(_target), _reference, rel_tolerance_f16,
tolerance_num, abs_tolerance_convolution_layer_f16);
706 combine(datasets::SmallWinogradConvolutionLayer7x1Dataset(),
708 ActivationFunctionsSmallDataset,