Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 1 | /* |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 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 | { |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 46 | constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */ |
| 47 | constexpr AbsoluteTolerance<float> tolerance_quantized(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 | // *INDENT-OFF* |
| 89 | // clang-format off |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 90 | 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] | 91 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type |
| 92 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape |
| 93 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type |
| 94 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape |
| 95 | TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink |
| 96 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 97 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 98 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 99 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
| 100 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 101 | TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32), |
| 103 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 104 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 105 | framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16), |
| 106 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 107 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 108 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 110 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 111 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 112 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), |
| 113 | TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), |
| 114 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 115 | TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32), |
| 116 | TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32), |
| 117 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 118 | })), |
| 119 | framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0), |
| 120 | PadStrideInfo(1, 1, 0, 0), |
| 121 | PadStrideInfo(1, 1, 0, 0), |
| 122 | PadStrideInfo(1, 1, 0, 0), |
| 123 | PadStrideInfo(1, 1, 1, 1), |
| 124 | PadStrideInfo(1, 1, 0, 0), |
| 125 | })), |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 126 | framework::dataset::make("Expected", { false, false, false, false, false, true })), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 127 | input_info, weights_info, bias_info, output_info, pad_info, expected) |
Alex Gilday | 27c08ab | 2018-02-22 11:36:16 +0000 | [diff] [blame] | 128 | { |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 129 | 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] | 130 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 131 | } |
| 132 | // clang-format on |
| 133 | // *INDENT-ON* |
| 134 | |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 135 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 136 | using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>; |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 137 | |
| 138 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 139 | using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 140 | |
| 141 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 142 | using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
| 143 | |
| 144 | template <typename T> |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 145 | using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>; |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 146 | |
| 147 | TEST_SUITE(Float) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 148 | TEST_SUITE(FP32) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 149 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 150 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)), |
| 151 | data_layouts_dataset), |
| 152 | add_bias_dataset)) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 153 | { |
| 154 | // Validate output |
| 155 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 156 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 157 | TEST_SUITE_END() // W4x4 |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 158 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 159 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 160 | DataType::F32)), |
| 161 | data_layouts_dataset), |
| 162 | add_bias_dataset)) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 163 | { |
| 164 | // Validate output |
| 165 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 166 | } |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 167 | FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType", |
| 168 | DataType::F32)), |
| 169 | data_layouts_dataset), |
| 170 | add_bias_dataset)) |
| 171 | { |
| 172 | // Validate output |
| 173 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 174 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 175 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)), |
| 176 | data_layouts_dataset), |
| 177 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 178 | { |
| 179 | // Validate output |
| 180 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 181 | } |
| 182 | TEST_SUITE_END() // W3x3 |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 183 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 184 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)), |
| 185 | data_layouts_dataset), |
| 186 | add_bias_dataset)) |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 187 | { |
| 188 | // Validate output |
| 189 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 190 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 191 | TEST_SUITE_END() // W1x1 |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 192 | TEST_SUITE_END() // FP32 |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 193 | |
| 194 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 195 | TEST_SUITE(FP16) |
| 196 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 197 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)), |
| 198 | data_layouts_dataset), |
| 199 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 200 | { |
| 201 | // Validate output |
| 202 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 203 | } |
| 204 | TEST_SUITE_END() // W4x4 |
| 205 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 206 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 207 | DataType::F16)), |
| 208 | data_layouts_dataset), |
| 209 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 210 | { |
| 211 | // Validate output |
| 212 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 213 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 214 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)), |
| 215 | data_layouts_dataset), |
| 216 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 217 | { |
| 218 | // Validate output |
| 219 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 220 | } |
| 221 | TEST_SUITE_END() // W3x3 |
| 222 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 223 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)), |
| 224 | data_layouts_dataset), |
| 225 | add_bias_dataset)) |
Manuel Bottini | f391fff | 2019-05-15 13:01:26 +0100 | [diff] [blame] | 226 | { |
| 227 | // Validate output |
| 228 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 229 | } |
| 230 | TEST_SUITE_END() // W1x1 |
| 231 | TEST_SUITE_END() // FP16 |
| 232 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
| 233 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 234 | TEST_SUITE_END() // Float |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 235 | |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 236 | template <typename T> |
| 237 | using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>; |
| 238 | |
| 239 | template <typename T> |
| 240 | using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>; |
| 241 | |
| 242 | template <typename T> |
| 243 | using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>; |
| 244 | |
| 245 | TEST_SUITE(Quantized) |
| 246 | TEST_SUITE(QASYMM8) |
| 247 | |
| 248 | TEST_SUITE(W4x4) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 249 | 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] | 250 | DataType::QASYMM8)), |
| 251 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 252 | input_qinfo_dataset), |
| 253 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 254 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 255 | { |
| 256 | // Validate output |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 257 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 258 | } |
| 259 | TEST_SUITE_END() // W4x4 |
| 260 | |
| 261 | TEST_SUITE(W3x3) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 262 | 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] | 263 | framework::dataset::make("DataType", |
| 264 | DataType::QASYMM8)), |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 265 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 266 | input_qinfo_dataset), |
| 267 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 268 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 269 | { |
| 270 | // Validate output |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 271 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 272 | } |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 273 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 274 | framework::dataset::make("DataType", |
| 275 | DataType::QASYMM8)), |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 276 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 277 | input_qinfo_dataset), |
| 278 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 279 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 280 | { |
| 281 | // Validate output |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 282 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 283 | } |
| 284 | TEST_SUITE_END() // W3x3 |
| 285 | |
| 286 | TEST_SUITE(W1x1) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 287 | 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] | 288 | DataType::QASYMM8)), |
| 289 | data_layouts_dataset), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 290 | input_qinfo_dataset), |
| 291 | output_qinfo_dataset), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 292 | add_bias_dataset)) |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 293 | { |
| 294 | // Validate output |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 295 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 296 | } |
| 297 | TEST_SUITE_END() // W1x1 |
| 298 | |
| 299 | TEST_SUITE_END() // QASYMM8 |
Luca Foschiani | fedefc3 | 2020-02-17 17:02:49 +0000 | [diff] [blame] | 300 | |
| 301 | TEST_SUITE(QASYMM8_SIGNED) |
| 302 | |
| 303 | TEST_SUITE(W4x4) |
| 304 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType", |
| 305 | DataType::QASYMM8_SIGNED)), |
| 306 | data_layouts_dataset), |
| 307 | input_qinfo_dataset), |
| 308 | output_qinfo_dataset), |
| 309 | add_bias_dataset)) |
| 310 | { |
| 311 | // Validate output |
| 312 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
| 313 | } |
| 314 | TEST_SUITE_END() // W4x4 |
| 315 | |
| 316 | TEST_SUITE(W3x3) |
| 317 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit, |
| 318 | framework::dataset::make("DataType", |
| 319 | DataType::QASYMM8_SIGNED)), |
| 320 | data_layouts_dataset), |
| 321 | input_qinfo_dataset), |
| 322 | output_qinfo_dataset), |
| 323 | add_bias_dataset)) |
| 324 | { |
| 325 | // Validate output |
| 326 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
| 327 | } |
| 328 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 329 | framework::dataset::make("DataType", |
| 330 | DataType::QASYMM8_SIGNED)), |
| 331 | data_layouts_dataset), |
| 332 | input_qinfo_dataset), |
| 333 | output_qinfo_dataset), |
| 334 | add_bias_dataset)) |
| 335 | { |
| 336 | // Validate output |
| 337 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
| 338 | } |
| 339 | TEST_SUITE_END() // W3x3 |
| 340 | |
| 341 | TEST_SUITE(W1x1) |
| 342 | FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType", |
| 343 | DataType::QASYMM8_SIGNED)), |
| 344 | data_layouts_dataset), |
| 345 | input_qinfo_dataset), |
| 346 | output_qinfo_dataset), |
| 347 | add_bias_dataset)) |
| 348 | { |
| 349 | // Validate output |
| 350 | validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num); |
| 351 | } |
| 352 | TEST_SUITE_END() // W1x1 |
| 353 | |
| 354 | TEST_SUITE_END() // QASYMM8_SIGNED |
Usama Arif | 2899e00 | 2019-04-16 14:32:25 +0100 | [diff] [blame] | 355 | TEST_SUITE_END() // Quantized |
| 356 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 357 | TEST_SUITE_END() // DeconvolutionLayer |
| 358 | TEST_SUITE_END() // NEON |
Pablo Tello | f5f34bb | 2017-08-22 13:34:13 +0100 | [diff] [blame] | 359 | } // namespace validation |
| 360 | } // namespace test |
| 361 | } // namespace arm_compute |