Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | 5ce99a2 | 2019-01-25 14:17:49 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 25 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 26 | #include "arm_compute/runtime/NEON/functions/NEDeconvolutionLayer.h" |
| 27 | #include "arm_compute/runtime/Tensor.h" |
| 28 | #include "arm_compute/runtime/TensorAllocator.h" |
| 29 | #include "tests/NEON/Accessor.h" |
| 30 | #include "tests/PaddingCalculator.h" |
| 31 | #include "tests/datasets/ShapeDatasets.h" |
| 32 | #include "tests/framework/Asserts.h" |
| 33 | #include "tests/framework/Macros.h" |
| 34 | #include "tests/framework/datasets/Datasets.h" |
| 35 | #include "tests/validation/Validation.h" |
| 36 | #include "tests/validation/fixtures/DeconvolutionLayerFixture.h" |
| 37 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace validation |
| 43 | { |
| 44 | namespace |
| 45 | { |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 46 | constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */ |
| 47 | constexpr AbsoluteTolerance<float> tolerance_qasymm8(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */ |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 48 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 49 | const RelativeTolerance<half_float::half> tolerance_fp16(half_float::half(0.2f)); /**< Relative tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 50 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/ |
| 51 | constexpr float tolerance_num = 0.07f; /**< Tolerance number */ |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 52 | |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 53 | const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 54 | * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 }); |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 55 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 56 | const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 57 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 58 | |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 59 | const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1) |
| 60 | * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
| 61 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 62 | const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 63 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 64 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 65 | const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 66 | * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 67 | |
Manuel Bottini | d25af67 | 2019-07-10 17:06:12 +0100 | [diff] [blame] | 68 | const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }); |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 69 | |
| 70 | const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false }); |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 71 | |
| 72 | const auto input_qinfo_dataset = framework::dataset::make("InputQInfo", |
| 73 | { |
| 74 | QuantizationInfo(1.f / 255.f, 0), |
| 75 | QuantizationInfo(2.f, 0), |
| 76 | }); |
| 77 | |
| 78 | const auto output_qinfo_dataset = framework::dataset::make("OutputQInfo", |
| 79 | { |
| 80 | QuantizationInfo(3.f / 255.f, 0), |
| 81 | QuantizationInfo(4.f, 0), |
| 82 | }); |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 83 | } // namespace |
| 84 | |
| 85 | TEST_SUITE(NEON) |
| 86 | TEST_SUITE(DeconvolutionLayer) |
| 87 | |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 88 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, (combine(datasets::SmallDeconvolutionShapes(), framework::dataset::make("DataType", DataType::F32))), |
| 89 | input_shape, data_type) |
| 90 | { |
| 91 | // Create shapes |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 92 | const unsigned int kernel_size_x = 3; |
| 93 | const unsigned int kernel_size_y = 3; |
| 94 | const unsigned int num_kernels = 1; |
| 95 | const TensorShape weights_shape(kernel_size_x, kernel_size_y, input_shape.z(), num_kernels); |
| 96 | const TensorShape bias_shape(num_kernels); |
| 97 | const PadStrideInfo info(1, 1, 1, 1); |
| 98 | auto out_dim = deconvolution_output_dimensions(input_shape.x(), input_shape.y(), kernel_size_x, kernel_size_y, info); |
| 99 | TensorShape output_shape = compute_deconvolution_output_shape(out_dim, TensorInfo(input_shape, 1, data_type), TensorInfo(weights_shape, 1, data_type)); |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 100 | |
| 101 | // Create tensors |
| 102 | Tensor src = create_tensor<Tensor>(input_shape, data_type, 1); |
| 103 | Tensor weights = create_tensor<Tensor>(weights_shape, data_type, 1); |
| 104 | Tensor bias = create_tensor<Tensor>(bias_shape, data_type, 1); |
| 105 | Tensor dst = create_tensor<Tensor>(output_shape, data_type, 1); |
| 106 | |
| 107 | ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 108 | ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 109 | ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 110 | ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 111 | |
| 112 | // Create and configure function |
| 113 | NEDeconvolutionLayer deconv; |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 114 | deconv.configure(&src, &weights, &bias, &dst, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL)); |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 115 | |
| 116 | // Validate valid region |
| 117 | const ValidRegion src_valid_region = shape_to_valid_region(input_shape); |
| 118 | const ValidRegion weights_valid_region = shape_to_valid_region(weights_shape); |
| 119 | const ValidRegion bias_valid_region = shape_to_valid_region(bias_shape); |
| 120 | const ValidRegion dst_valid_region = shape_to_valid_region(output_shape); |
| 121 | |
| 122 | validate(src.info()->valid_region(), src_valid_region); |
| 123 | validate(weights.info()->valid_region(), weights_valid_region); |
| 124 | validate(bias.info()->valid_region(), bias_valid_region); |
| 125 | validate(dst.info()->valid_region(), dst_valid_region); |
| 126 | } |
| 127 | |
| 128 | // *INDENT-OFF* |
| 129 | // clang-format off |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 130 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 131 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type |
| 132 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape |
| 133 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type |
| 134 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape |
| 135 | TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink |
| 136 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 137 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 138 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 139 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
| 140 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 141 | TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32), |
| 142 | TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32), |
| 143 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 144 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 145 | framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16), |
| 146 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 147 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 148 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32), |
| 149 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 150 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 151 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 152 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), |
| 153 | TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), |
| 154 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 155 | TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32), |
| 156 | TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32), |
| 157 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 158 | })), |
| 159 | framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0), |
| 160 | PadStrideInfo(1, 1, 0, 0), |
| 161 | PadStrideInfo(1, 1, 0, 0), |
| 162 | PadStrideInfo(1, 1, 0, 0), |
| 163 | PadStrideInfo(1, 1, 1, 1), |
| 164 | PadStrideInfo(1, 1, 0, 0), |
| 165 | })), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 166 | framework::dataset::make("Expected", { false, false, false, false, false, true })), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 167 | input_info, weights_info, bias_info, output_info, pad_info, expected) |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 168 | { |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 169 | 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)); |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 170 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 171 | } |
| 172 | // clang-format on |
| 173 | // *INDENT-ON* |
| 174 | |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 175 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 176 | using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>; |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 177 | |
| 178 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 179 | using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 180 | |
| 181 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 182 | using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
| 183 | |
| 184 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 185 | using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>; |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 186 | |
| 187 | TEST_SUITE(Float) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 188 | TEST_SUITE(FP32) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 189 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 190 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)), |
| 191 | data_layouts_dataset), |
| 192 | add_bias_dataset)) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 193 | { |
| 194 | // Validate output |
| 195 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 196 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 197 | TEST_SUITE_END() // W4x4 |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 198 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 199 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 200 | DataType::F32)), |
| 201 | data_layouts_dataset), |
| 202 | add_bias_dataset)) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 203 | { |
| 204 | // Validate output |
| 205 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 206 | } |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 207 | FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType", |
| 208 | DataType::F32)), |
| 209 | data_layouts_dataset), |
| 210 | add_bias_dataset)) |
| 211 | { |
| 212 | // Validate output |
| 213 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 214 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 215 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)), |
| 216 | data_layouts_dataset), |
| 217 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 218 | { |
| 219 | // Validate output |
| 220 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 221 | } |
| 222 | TEST_SUITE_END() // W3x3 |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 223 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 224 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)), |
| 225 | data_layouts_dataset), |
| 226 | add_bias_dataset)) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 227 | { |
| 228 | // Validate output |
| 229 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 230 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 231 | TEST_SUITE_END() // W1x1 |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 232 | TEST_SUITE_END() // FP32 |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 233 | |
| 234 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 235 | TEST_SUITE(FP16) |
| 236 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 237 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)), |
| 238 | data_layouts_dataset), |
| 239 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 240 | { |
| 241 | // Validate output |
| 242 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 243 | } |
| 244 | TEST_SUITE_END() // W4x4 |
| 245 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 246 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 247 | DataType::F16)), |
| 248 | data_layouts_dataset), |
| 249 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 250 | { |
| 251 | // Validate output |
| 252 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 253 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 254 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)), |
| 255 | data_layouts_dataset), |
| 256 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 257 | { |
| 258 | // Validate output |
| 259 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 260 | } |
| 261 | TEST_SUITE_END() // W3x3 |
| 262 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 263 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)), |
| 264 | data_layouts_dataset), |
| 265 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 266 | { |
| 267 | // Validate output |
| 268 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 269 | } |
| 270 | TEST_SUITE_END() // W1x1 |
| 271 | TEST_SUITE_END() // FP16 |
| 272 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
| 273 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 274 | TEST_SUITE_END() // Float |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 275 | |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 276 | template <typename T> |
| 277 | using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>; |
| 278 | |
| 279 | template <typename T> |
| 280 | using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
| 281 | |
| 282 | template <typename T> |
| 283 | using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>; |
| 284 | |
| 285 | TEST_SUITE(Quantized) |
| 286 | TEST_SUITE(QASYMM8) |
| 287 | |
| 288 | TEST_SUITE(W4x4) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 289 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType", |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 290 | DataType::QASYMM8)), |
| 291 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 292 | input_qinfo_dataset), |
| 293 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 294 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 295 | { |
| 296 | // Validate output |
| 297 | validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 298 | } |
| 299 | TEST_SUITE_END() // W4x4 |
| 300 | |
| 301 | TEST_SUITE(W3x3) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 302 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit, |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 303 | framework::dataset::make("DataType", |
| 304 | DataType::QASYMM8)), |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 305 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 306 | input_qinfo_dataset), |
| 307 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 308 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 309 | { |
| 310 | // Validate output |
| 311 | validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 312 | } |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 313 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 314 | framework::dataset::make("DataType", |
| 315 | DataType::QASYMM8)), |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 316 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 317 | input_qinfo_dataset), |
| 318 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 319 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 320 | { |
| 321 | // Validate output |
| 322 | validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 323 | } |
| 324 | TEST_SUITE_END() // W3x3 |
| 325 | |
| 326 | TEST_SUITE(W1x1) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 327 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType", |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 328 | DataType::QASYMM8)), |
| 329 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 330 | input_qinfo_dataset), |
| 331 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 332 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 333 | { |
| 334 | // Validate output |
| 335 | validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 336 | } |
| 337 | TEST_SUITE_END() // W1x1 |
| 338 | |
| 339 | TEST_SUITE_END() // QASYMM8 |
| 340 | TEST_SUITE_END() // Quantized |
| 341 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 342 | TEST_SUITE_END() // DeconvolutionLayer |
| 343 | TEST_SUITE_END() // NEON |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 344 | } // namespace validation |
| 345 | } // namespace test |
| 346 | } // namespace arm_compute |