xref: /aosp_15_r20/external/ComputeLibrary/tests/validation/NEON/DeconvolutionLayer.cpp (revision c217d954acce2dbc11938adb493fc0abd69584f3)
1 /*
2  * Copyright (c) 2017-2021, 2023 Arm Limited.
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"
25 #include "arm_compute/core/utils/misc/ShapeCalculator.h"
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 {
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 */
48 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
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 constexpr float                           tolerance_num_fp16 = 0.01f;             /**< Tolerance number for FP16 tests -- follows a slightly stricter approach compared to ConvolutionLayer tests */
51 #endif                                                                            /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC*/
52 constexpr float tolerance_num_quant = 0.07f;                                      /**< Tolerance number for quantized types */
53 
54 const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3)
55                      * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 });
56 
57 const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2)
58                      * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
59 
60 const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1)
61                            * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 });
62 
63 const auto data9x9_small_asymm = framework::dataset::make("InputShape", TensorShape{ 10U, 10U, 1U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
64                                  2)
65                                  *framework::dataset::make("PadLeft", 3)
66                                  *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });
67 
68 const auto data9x9_large_asymm = framework::dataset::make("InputShape", TensorShape{ 640U, 360U, 56U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
69                                  2)
70                                  *framework::dataset::make("PadLeft", 3)
71                                  *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });
72 
73 const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2)
74                                * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
75 
76 const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1)
77                      * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });
78 
79 const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC });
80 
81 const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false });
82 
83 const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
84 {
85     QuantizationInfo(1.f / 255.f, 0),
86     QuantizationInfo(2.f, 0),
87 });
88 
89 const auto output_qinfo_dataset = framework::dataset::make("OutputQInfo",
90 {
91     QuantizationInfo(3.f / 255.f, 0),
92     QuantizationInfo(4.f, 0),
93 });
94 
95 } // namespace
96 
97 TEST_SUITE(NEON)
TEST_SUITE(DeconvolutionLayer)98 TEST_SUITE(DeconvolutionLayer)
99 
100 // *INDENT-OFF*
101 // clang-format off
102 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
103     framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),   // Mismatching data type
104                                             TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),   // Invalid weights shape
105                                             TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16),   // Non supported data type
106                                             TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),  // Invalid bias shape
107                                             TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
108                                             TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
109                                           }),
110     framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
111                                             TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
112                                             TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
113                                             TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
114                                             TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
115                                               TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
116                                           })),
117     framework::dataset::make("BiasInfo",  { TensorInfo(TensorShape(1U), 1, DataType::F16),
118                                             TensorInfo(TensorShape(1U), 1, DataType::F32),
119                                             TensorInfo(TensorShape(1U), 1, DataType::F32),
120                                             TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
121                                             TensorInfo(TensorShape(1U), 1, DataType::F32),
122                                             TensorInfo(TensorShape(4U), 1, DataType::F32),
123                                           })),
124     framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
125                                             TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
126                                             TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
127                                             TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
128                                             TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
129                                             TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
130                                           })),
131     framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
132                                                 PadStrideInfo(1, 1, 0, 0),
133                                                 PadStrideInfo(1, 1, 0, 0),
134                                                 PadStrideInfo(1, 1, 0, 0),
135                                                 PadStrideInfo(1, 1, 1, 1),
136                                                 PadStrideInfo(1, 1, 0, 0),
137                                            })),
138     framework::dataset::make("Expected", { false, false, false, false, false, true })),
139     input_info, weights_info, bias_info, output_info, pad_info, expected)
140 {
141     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));
142     ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
143 }
144 // clang-format on
145 // *INDENT-ON*
146 
147 template <typename T>
148 using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
149 
150 template <typename T>
151 using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
152 
153 template <typename T>
154 using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
155 
156 template <typename T>
157 using NEDeconvolutionLayerAsymmFixture9x9 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 9, 9>;
158 
159 template <typename T>
160 using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
161 
162 TEST_SUITE(Float)
TEST_SUITE(FP32)163 TEST_SUITE(FP32)
164 TEST_SUITE(W4x4)
165 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)),
166                                                                                                                     data_layouts_dataset),
167                                                                                                             add_bias_dataset))
168 {
169     // Validate output
170     validate(Accessor(_target), _reference, tolerance_fp32);
171 }
172 TEST_SUITE_END() // W4x4
TEST_SUITE(W3x3)173 TEST_SUITE(W3x3)
174 FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
175                                                                                                                    DataType::F32)),
176                                                                                                                    data_layouts_dataset),
177                                                                                                                    add_bias_dataset))
178 {
179     // Validate output
180     validate(Accessor(_target), _reference, tolerance_fp32);
181 }
182 FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType",
183                                                                                                                       DataType::F32)),
184                                                                                                                       data_layouts_dataset),
185                                                                                                                       add_bias_dataset))
186 {
187     // Validate output
188     validate(Accessor(_target), _reference, tolerance_fp32);
189 }
190 FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)),
191                                                                                                                  data_layouts_dataset),
192                                                                                                                  add_bias_dataset))
193 {
194     // Validate output
195     validate(Accessor(_target), _reference, tolerance_fp32);
196 }
197 TEST_SUITE_END() // W3x3
TEST_SUITE(W1x1)198 TEST_SUITE(W1x1)
199 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)),
200                                                                                                                     data_layouts_dataset),
201                                                                                                             add_bias_dataset))
202 {
203     // Validate output
204     validate(Accessor(_target), _reference, tolerance_fp32);
205 }
206 TEST_SUITE_END() // W1x1
TEST_SUITE(W9x9)207 TEST_SUITE(W9x9)
208 FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::ALL, combine(combine(combine(data9x9_small_asymm, framework::dataset::make("DataType",
209                                                                                                                   DataType::F32)),
210                                                                                                                   framework::dataset::make("DataLayout", { DataLayout::NHWC })),
211                                                                                                                   framework::dataset::make("AddBias", { false })))
212 {
213     // Validate output
214     validate(Accessor(_target), _reference, tolerance_fp32);
215 }
216 FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data9x9_large_asymm, framework::dataset::make("DataType",
217                                                                                                                       DataType::F32)),
218                                                                                                                       framework::dataset::make("DataLayout", { DataLayout::NHWC })),
219                                                                                                                       framework::dataset::make("AddBias", { false })))
220 {
221     // Validate output
222     validate(Accessor(_target), _reference, tolerance_fp32);
223 }
224 TEST_SUITE_END() // W9x9
TEST_SUITE_END()225 TEST_SUITE_END() // FP32
226 
227 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
228 TEST_SUITE(FP16)
229 TEST_SUITE(W4x4)
230 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)),
231                                                                                                                    data_layouts_dataset),
232                                                                                                            add_bias_dataset))
233 {
234     // Validate output
235     validate(Accessor(_target), _reference, tolerance_fp16, tolerance_num_fp16);
236 }
237 TEST_SUITE_END() // W4x4
TEST_SUITE(W3x3)238 TEST_SUITE(W3x3)
239 FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
240                                                                                                                   DataType::F16)),
241                                                                                                                   data_layouts_dataset),
242                                                                                                                   add_bias_dataset))
243 {
244     // Validate output
245     validate(Accessor(_target), _reference, tolerance_fp16, tolerance_num_fp16);
246 }
247 FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)),
248                                                                                                                         data_layouts_dataset),
249                                                                                                                 add_bias_dataset))
250 {
251     // Validate output
252     validate(Accessor(_target), _reference, tolerance_fp16, tolerance_num_fp16);
253 }
254 TEST_SUITE_END() // W3x3
TEST_SUITE(W1x1)255 TEST_SUITE(W1x1)
256 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)),
257                                                                                                                    data_layouts_dataset),
258                                                                                                            add_bias_dataset))
259 {
260     // Validate output
261     validate(Accessor(_target), _reference, tolerance_fp16, tolerance_num_fp16);
262 }
263 TEST_SUITE_END() // W1x1
264 TEST_SUITE_END() // FP16
265 #endif           /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
266 
267 TEST_SUITE_END() // Float
268 
269 template <typename T>
270 using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
271 
272 template <typename T>
273 using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
274 
275 template <typename T>
276 using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
277 
278 template <typename T>
279 using NEDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 4, 4>;
280 
281 template <typename T>
282 using NEDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 3, 3>;
283 
284 template <typename T>
285 using NEDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 1, 1>;
286 
287 TEST_SUITE(Quantized)
TEST_SUITE(QASYMM8)288 TEST_SUITE(QASYMM8)
289 
290 TEST_SUITE(W4x4)
291 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
292                                                                                                                        DataType::QASYMM8)),
293                                                                                                                        data_layouts_dataset),
294                                                                                                                        input_qinfo_dataset),
295                                                                                                                        output_qinfo_dataset),
296                                                                                                                        add_bias_dataset))
297 {
298     // Validate output
299     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
300 }
301 TEST_SUITE_END() // W4x4
302 
TEST_SUITE(W3x3)303 TEST_SUITE(W3x3)
304 FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
305                        framework::dataset::make("DataType",
306                                                 DataType::QASYMM8)),
307                        data_layouts_dataset),
308                        input_qinfo_dataset),
309                        output_qinfo_dataset),
310                        add_bias_dataset))
311 {
312     // Validate output
313     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
314 }
315 FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
316                        framework::dataset::make("DataType",
317                                                 DataType::QASYMM8)),
318                        data_layouts_dataset),
319                        input_qinfo_dataset),
320                        output_qinfo_dataset),
321                        add_bias_dataset))
322 {
323     // Validate output
324     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
325 }
326 TEST_SUITE_END() // W3x3
327 
TEST_SUITE(W1x1)328 TEST_SUITE(W1x1)
329 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType",
330                                                                                                                        DataType::QASYMM8)),
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_quant);
338 }
339 TEST_SUITE_END() // W1x1
340 
TEST_SUITE_END()341 TEST_SUITE_END() // QASYMM8
342 
343 TEST_SUITE(QASYMM8_SIGNED)
344 
345 TEST_SUITE(W4x4)
346 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
347                                                                                                                       DataType::QASYMM8_SIGNED)),
348                                                                                                                       data_layouts_dataset),
349                                                                                                                       input_qinfo_dataset),
350                                                                                                                       output_qinfo_dataset),
351                                                                                                                       add_bias_dataset))
352 {
353     // Validate output
354     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
355 }
356 TEST_SUITE_END() // W4x4
357 
TEST_SUITE(W3x3)358 TEST_SUITE(W3x3)
359 FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
360                        framework::dataset::make("DataType",
361                                                 DataType::QASYMM8_SIGNED)),
362                        data_layouts_dataset),
363                        input_qinfo_dataset),
364                        output_qinfo_dataset),
365                        add_bias_dataset))
366 {
367     // Validate output
368     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
369 }
370 FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
371                        framework::dataset::make("DataType",
372                                                 DataType::QASYMM8_SIGNED)),
373                        data_layouts_dataset),
374                        input_qinfo_dataset),
375                        output_qinfo_dataset),
376                        add_bias_dataset))
377 {
378     // Validate output
379     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
380 }
381 TEST_SUITE_END() // W3x3
382 
TEST_SUITE(W1x1)383 TEST_SUITE(W1x1)
384 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1,
385                                                                                                                       framework::dataset::make("DataType",
386                                                                                                                               DataType::QASYMM8_SIGNED)),
387                                                                                                                       data_layouts_dataset),
388                                                                                                                       input_qinfo_dataset),
389                                                                                                                       output_qinfo_dataset),
390                                                                                                                       add_bias_dataset))
391 {
392     // Validate output
393     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
394 }
395 TEST_SUITE_END() // W1x1
396 
397 TEST_SUITE_END() // QASYMM8_SIGNED
398 
399 const auto input_qinfo_per_channel_dataset         = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) });
400 const auto output_qinfo_per_channel_dataset        = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) });
401 const auto input_signed_qinfo_per_channel_dataset  = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) });
402 const auto output_signed_qinfo_per_channel_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) });
403 
404 TEST_SUITE(QSYMM8_PER_CHANNEL)
405 
TEST_SUITE(W4x4)406 TEST_SUITE(W4x4)
407 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
408                        framework::dataset::make("DataType", DataType::QASYMM8)),
409                        data_layouts_dataset),
410                        input_qinfo_per_channel_dataset),
411                        output_qinfo_per_channel_dataset),
412                        add_bias_dataset),
413                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
414 {
415     // Validate output
416     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
417 }
418 FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
419                        framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
420                        data_layouts_dataset),
421                        input_signed_qinfo_per_channel_dataset),
422                        output_signed_qinfo_per_channel_dataset),
423                        add_bias_dataset),
424                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
425 {
426     // Validate output
427     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
428 }
429 TEST_SUITE_END() // W4x4
430 
TEST_SUITE(W3x3)431 TEST_SUITE(W3x3)
432 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
433                        framework::dataset::make("DataType", DataType::QASYMM8)),
434                        data_layouts_dataset),
435                        input_qinfo_per_channel_dataset),
436                        output_qinfo_per_channel_dataset),
437                        add_bias_dataset),
438                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
439 {
440     // Validate output
441     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
442 }
443 FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
444                        framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
445                        data_layouts_dataset),
446                        input_signed_qinfo_per_channel_dataset),
447                        output_signed_qinfo_per_channel_dataset),
448                        add_bias_dataset),
449                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
450 {
451     // Validate output
452     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
453 }
454 TEST_SUITE_END() // W3x3
455 
TEST_SUITE(W1x1)456 TEST_SUITE(W1x1)
457 FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
458                        framework::dataset::make("DataType", DataType::QASYMM8)),
459                        data_layouts_dataset),
460                        input_qinfo_per_channel_dataset),
461                        output_qinfo_per_channel_dataset),
462                        add_bias_dataset),
463                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
464 {
465     // Validate output
466     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
467 }
468 FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
469                        framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
470                        data_layouts_dataset),
471                        input_signed_qinfo_per_channel_dataset),
472                        output_signed_qinfo_per_channel_dataset),
473                        add_bias_dataset),
474                        framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
475 {
476     // Validate output
477     validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num_quant);
478 }
479 TEST_SUITE_END() // W1x1
480 
481 TEST_SUITE_END() // QSYMM8_PER_CHANNEL
482 
483 TEST_SUITE_END() // Quantized
484 
485 TEST_SUITE_END() // DeconvolutionLayer
486 TEST_SUITE_END() // Neon
487 } // namespace validation
488 } // namespace test
489 } // namespace arm_compute
490