blob: 4c6ee2615db9430b97dccdf721b1ff2e7b429e9e [file] [log] [blame]
Pablo Tellof5f34bb2017-08-22 13:34:13 +01001/*
Sheri Zhangac6499a2021-02-10 15:32:38 +00002 * Copyright (c) 2017-2021 Arm Limited.
Pablo Tellof5f34bb2017-08-22 13:34:13 +01003 *
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 Giorgioed5a4922018-09-13 16:22:01 +010025#include "arm_compute/core/utils/misc/ShapeCalculator.h"
Pablo Tellof5f34bb2017-08-22 13:34:13 +010026#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
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
44namespace
45{
Luca Foschianifedefc32020-02-17 17:02:49 +000046constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */
47constexpr AbsoluteTolerance<float> tolerance_quantized(1.0f); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
Manuel Bottinif391fff2019-05-15 13:01:26 +010048#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Manuel Bottinic1b76fa2019-06-17 12:04:40 +010049const 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*/
51constexpr float tolerance_num = 0.07f; /**< Tolerance number */
Pablo Tellof5f34bb2017-08-22 13:34:13 +010052
Georgios Pinitasced7a8d2018-02-01 16:31:33 +000053const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3)
giuros01a69a88b2019-01-31 16:29:19 +000054 * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 });
Georgios Pinitasced7a8d2018-02-01 16:31:33 +000055
Michalis Spyrou780db4e2017-11-23 09:49:51 +000056const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2)
giuros01a69a88b2019-01-31 16:29:19 +000057 * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
Pablo Tellof5f34bb2017-08-22 13:34:13 +010058
Matthew Jacksonb9070a42019-08-22 16:13:27 +010059const 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
Manuel Bottini6e10aa32020-04-30 13:28:23 +010062const auto data9x9_small_asymm = framework::dataset::make("InputShape", TensorShape{ 10U, 10U, 1U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
63 2)
64 *framework::dataset::make("PadLeft", 3)
65 *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });
66
67const auto data9x9_large_asymm = framework::dataset::make("InputShape", TensorShape{ 640U, 360U, 56U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
68 2)
69 *framework::dataset::make("PadLeft", 3)
70 *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });
71
Michalis Spyrou064add62018-11-01 18:14:27 +000072const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2)
giuros01a69a88b2019-01-31 16:29:19 +000073 * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
Michalis Spyrou064add62018-11-01 18:14:27 +000074
Michalis Spyrou780db4e2017-11-23 09:49:51 +000075const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1)
giuros01a69a88b2019-01-31 16:29:19 +000076 * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });
Pablo Tellof5f34bb2017-08-22 13:34:13 +010077
Manuel Bottinid25af672019-07-10 17:06:12 +010078const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC });
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +010079
80const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false });
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +000081
82const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
83{
84 QuantizationInfo(1.f / 255.f, 0),
85 QuantizationInfo(2.f, 0),
86});
87
88const auto output_qinfo_dataset = framework::dataset::make("OutputQInfo",
89{
90 QuantizationInfo(3.f / 255.f, 0),
91 QuantizationInfo(4.f, 0),
92});
Freddie Liardet9d061b02021-04-06 15:59:28 +010093
Pablo Tellof5f34bb2017-08-22 13:34:13 +010094} // namespace
95
96TEST_SUITE(NEON)
97TEST_SUITE(DeconvolutionLayer)
98
Alex Gilday27c08ab2018-02-22 11:36:16 +000099// *INDENT-OFF*
100// clang-format off
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100101DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100102 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type
103 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape
104 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type
105 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape
106 TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
107 TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000108 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100109 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
110 TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
111 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
112 TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
113 TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
114 TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000115 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100116 framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16),
117 TensorInfo(TensorShape(1U), 1, DataType::F32),
118 TensorInfo(TensorShape(1U), 1, DataType::F32),
119 TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
120 TensorInfo(TensorShape(1U), 1, DataType::F32),
121 TensorInfo(TensorShape(4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000122 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100123 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
124 TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
125 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
126 TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
127 TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
128 TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000129 })),
130 framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(1, 1, 0, 0),
132 PadStrideInfo(1, 1, 0, 0),
133 PadStrideInfo(1, 1, 0, 0),
134 PadStrideInfo(1, 1, 1, 1),
135 PadStrideInfo(1, 1, 0, 0),
136 })),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000137 framework::dataset::make("Expected", { false, false, false, false, false, true })),
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100138 input_info, weights_info, bias_info, output_info, pad_info, expected)
Alex Gilday27c08ab2018-02-22 11:36:16 +0000139{
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100140 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 Gilday27c08ab2018-02-22 11:36:16 +0000141 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
142}
143// clang-format on
144// *INDENT-ON*
145
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100146template <typename T>
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000147using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000148
149template <typename T>
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000150using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100151
152template <typename T>
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100153using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
154
155template <typename T>
Manuel Bottini6e10aa32020-04-30 13:28:23 +0100156using NEDeconvolutionLayerAsymmFixture9x9 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 9, 9>;
157
158template <typename T>
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000159using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100160
161TEST_SUITE(Float)
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100162TEST_SUITE(FP32)
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000163TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100164FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)),
165 data_layouts_dataset),
166 add_bias_dataset))
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000167{
168 // Validate output
169 validate(Accessor(_target), _reference, tolerance_fp32);
170}
Michalis Spyrou064add62018-11-01 18:14:27 +0000171TEST_SUITE_END() // W4x4
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100172TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100173FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
174 DataType::F32)),
175 data_layouts_dataset),
176 add_bias_dataset))
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100177{
178 // Validate output
179 validate(Accessor(_target), _reference, tolerance_fp32);
180}
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100181FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType",
182 DataType::F32)),
183 data_layouts_dataset),
184 add_bias_dataset))
185{
186 // Validate output
187 validate(Accessor(_target), _reference, tolerance_fp32);
188}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100189FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)),
190 data_layouts_dataset),
191 add_bias_dataset))
Michalis Spyrou064add62018-11-01 18:14:27 +0000192{
193 // Validate output
194 validate(Accessor(_target), _reference, tolerance_fp32);
195}
196TEST_SUITE_END() // W3x3
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100197TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100198FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)),
199 data_layouts_dataset),
200 add_bias_dataset))
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100201{
202 // Validate output
203 validate(Accessor(_target), _reference, tolerance_fp32);
204}
Michalis Spyrou064add62018-11-01 18:14:27 +0000205TEST_SUITE_END() // W1x1
Manuel Bottini6e10aa32020-04-30 13:28:23 +0100206TEST_SUITE(W9x9)
207FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::ALL, combine(combine(combine(data9x9_small_asymm, framework::dataset::make("DataType",
208 DataType::F32)),
209 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
210 framework::dataset::make("AddBias", { false })))
211{
212 // Validate output
213 validate(Accessor(_target), _reference, tolerance_fp32);
214}
215FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data9x9_large_asymm, framework::dataset::make("DataType",
216 DataType::F32)),
217 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
218 framework::dataset::make("AddBias", { false })))
219{
220 // Validate output
221 validate(Accessor(_target), _reference, tolerance_fp32);
222}
223TEST_SUITE_END() // W9x9
Michalis Spyrou064add62018-11-01 18:14:27 +0000224TEST_SUITE_END() // FP32
Manuel Bottinif391fff2019-05-15 13:01:26 +0100225
226#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
227TEST_SUITE(FP16)
228TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100229FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)),
230 data_layouts_dataset),
231 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100232{
233 // Validate output
234 validate(Accessor(_target), _reference, tolerance_fp16);
235}
236TEST_SUITE_END() // W4x4
237TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100238FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
239 DataType::F16)),
240 data_layouts_dataset),
241 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100242{
243 // Validate output
244 validate(Accessor(_target), _reference, tolerance_fp16);
245}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100246FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)),
247 data_layouts_dataset),
248 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100249{
250 // Validate output
251 validate(Accessor(_target), _reference, tolerance_fp16);
252}
253TEST_SUITE_END() // W3x3
254TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100255FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)),
256 data_layouts_dataset),
257 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100258{
259 // Validate output
260 validate(Accessor(_target), _reference, tolerance_fp16);
261}
262TEST_SUITE_END() // W1x1
263TEST_SUITE_END() // FP16
264#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
265
Michalis Spyrou064add62018-11-01 18:14:27 +0000266TEST_SUITE_END() // Float
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100267
Usama Arif2899e002019-04-16 14:32:25 +0100268template <typename T>
269using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
270
271template <typename T>
272using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
273
274template <typename T>
275using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
276
Freddie Liardet9d061b02021-04-06 15:59:28 +0100277template <typename T>
278using NEDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 4, 4>;
279
280template <typename T>
281using NEDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 3, 3>;
282
283template <typename T>
284using NEDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDeconvolutionLayer, T, int8_t, 1, 1>;
285
Usama Arif2899e002019-04-16 14:32:25 +0100286TEST_SUITE(Quantized)
287TEST_SUITE(QASYMM8)
288
289TEST_SUITE(W4x4)
Manuel Bottini279814b2019-10-25 10:28:28 +0100290FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
Usama Arif2899e002019-04-16 14:32:25 +0100291 DataType::QASYMM8)),
292 data_layouts_dataset),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000293 input_qinfo_dataset),
294 output_qinfo_dataset),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100295 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100296{
297 // Validate output
Luca Foschianifedefc32020-02-17 17:02:49 +0000298 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
Usama Arif2899e002019-04-16 14:32:25 +0100299}
300TEST_SUITE_END() // W4x4
301
302TEST_SUITE(W3x3)
Manuel Bottini279814b2019-10-25 10:28:28 +0100303FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100304 framework::dataset::make("DataType",
305 DataType::QASYMM8)),
Usama Arif2899e002019-04-16 14:32:25 +0100306 data_layouts_dataset),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000307 input_qinfo_dataset),
308 output_qinfo_dataset),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100309 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100310{
311 // Validate output
Luca Foschianifedefc32020-02-17 17:02:49 +0000312 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
Usama Arif2899e002019-04-16 14:32:25 +0100313}
Manuel Bottini279814b2019-10-25 10:28:28 +0100314FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
315 framework::dataset::make("DataType",
316 DataType::QASYMM8)),
Usama Arif2899e002019-04-16 14:32:25 +0100317 data_layouts_dataset),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000318 input_qinfo_dataset),
319 output_qinfo_dataset),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100320 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100321{
322 // Validate output
Luca Foschianifedefc32020-02-17 17:02:49 +0000323 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
Usama Arif2899e002019-04-16 14:32:25 +0100324}
325TEST_SUITE_END() // W3x3
326
327TEST_SUITE(W1x1)
Manuel Bottini279814b2019-10-25 10:28:28 +0100328FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType",
Usama Arif2899e002019-04-16 14:32:25 +0100329 DataType::QASYMM8)),
330 data_layouts_dataset),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000331 input_qinfo_dataset),
332 output_qinfo_dataset),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100333 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100334{
335 // Validate output
Luca Foschianifedefc32020-02-17 17:02:49 +0000336 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
Usama Arif2899e002019-04-16 14:32:25 +0100337}
338TEST_SUITE_END() // W1x1
339
340TEST_SUITE_END() // QASYMM8
Luca Foschianifedefc32020-02-17 17:02:49 +0000341
342TEST_SUITE(QASYMM8_SIGNED)
343
344TEST_SUITE(W4x4)
345FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
346 DataType::QASYMM8_SIGNED)),
347 data_layouts_dataset),
348 input_qinfo_dataset),
349 output_qinfo_dataset),
350 add_bias_dataset))
351{
352 // Validate output
353 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
354}
355TEST_SUITE_END() // W4x4
356
357TEST_SUITE(W3x3)
358FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
359 framework::dataset::make("DataType",
360 DataType::QASYMM8_SIGNED)),
361 data_layouts_dataset),
362 input_qinfo_dataset),
363 output_qinfo_dataset),
364 add_bias_dataset))
365{
366 // Validate output
367 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
368}
369FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
370 framework::dataset::make("DataType",
371 DataType::QASYMM8_SIGNED)),
372 data_layouts_dataset),
373 input_qinfo_dataset),
374 output_qinfo_dataset),
375 add_bias_dataset))
376{
377 // Validate output
378 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
379}
380TEST_SUITE_END() // W3x3
381
382TEST_SUITE(W1x1)
Freddie Liardet9d061b02021-04-06 15:59:28 +0100383FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1,
384 framework::dataset::make("DataType",
385 DataType::QASYMM8_SIGNED)),
Luca Foschianifedefc32020-02-17 17:02:49 +0000386 data_layouts_dataset),
387 input_qinfo_dataset),
388 output_qinfo_dataset),
389 add_bias_dataset))
390{
391 // Validate output
392 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
393}
394TEST_SUITE_END() // W1x1
395
396TEST_SUITE_END() // QASYMM8_SIGNED
Freddie Liardet9d061b02021-04-06 15:59:28 +0100397
398TEST_SUITE(QSYMM8_PER_CHANNEL)
399
400TEST_SUITE(W4x4)
401FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
402 framework::dataset::make("DataType", DataType::QASYMM8)),
403 data_layouts_dataset),
404 input_qinfo_dataset),
405 output_qinfo_dataset),
406 add_bias_dataset),
407 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
408{
409 // Validate output
410 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
411}
412FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
413 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
414 data_layouts_dataset),
415 input_qinfo_dataset),
416 output_qinfo_dataset),
417 add_bias_dataset),
418 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
419{
420 // Validate output
421 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
422}
423TEST_SUITE_END() // W4x4
424
425TEST_SUITE(W3x3)
426FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
427 framework::dataset::make("DataType", DataType::QASYMM8)),
428 data_layouts_dataset),
429 input_qinfo_dataset),
430 output_qinfo_dataset),
431 add_bias_dataset),
432 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
433{
434 // Validate output
435 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
436}
437FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
438 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
439 data_layouts_dataset),
440 input_qinfo_dataset),
441 output_qinfo_dataset),
442 add_bias_dataset),
443 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
444{
445 // Validate output
446 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
447}
448TEST_SUITE_END() // W3x3
449
450TEST_SUITE(W1x1)
451FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
452 framework::dataset::make("DataType", DataType::QASYMM8)),
453 data_layouts_dataset),
454 input_qinfo_dataset),
455 output_qinfo_dataset),
456 add_bias_dataset),
457 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
458{
459 // Validate output
460 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
461}
462FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
463 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
464 data_layouts_dataset),
465 input_qinfo_dataset),
466 output_qinfo_dataset),
467 add_bias_dataset),
468 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
469{
470 // Validate output
471 validate(Accessor(_target), _reference, tolerance_quantized, tolerance_num);
472}
473TEST_SUITE_END() // W1x1
474
475TEST_SUITE_END() // QSYMM8_PER_CHANNEL
476
Usama Arif2899e002019-04-16 14:32:25 +0100477TEST_SUITE_END() // Quantized
478
Michalis Spyrou064add62018-11-01 18:14:27 +0000479TEST_SUITE_END() // DeconvolutionLayer
Sheri Zhangac6499a2021-02-10 15:32:38 +0000480TEST_SUITE_END() // Neon
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100481} // namespace validation
482} // namespace test
483} // namespace arm_compute