blob: b6911c6dbce261604fa97cabb24f41262001f922 [file] [log] [blame]
Pablo Tellof5f34bb2017-08-22 13:34:13 +01001/*
Michalis Spyrou5ce99a22019-01-25 14:17:49 +00002 * Copyright (c) 2017-2019 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{
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +010046constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */
47constexpr AbsoluteTolerance<float> tolerance_qasymm8(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
Michalis Spyrou064add62018-11-01 18:14:27 +000062const 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 +000063 * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
Michalis Spyrou064add62018-11-01 18:14:27 +000064
Michalis Spyrou780db4e2017-11-23 09:49:51 +000065const 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 +000066 * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });
Pablo Tellof5f34bb2017-08-22 13:34:13 +010067
Manuel Bottinid25af672019-07-10 17:06:12 +010068const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC });
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +010069
70const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false });
Pablo Tellof5f34bb2017-08-22 13:34:13 +010071} // namespace
72
73TEST_SUITE(NEON)
74TEST_SUITE(DeconvolutionLayer)
75
Alex Gilday27c08ab2018-02-22 11:36:16 +000076DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, (combine(datasets::SmallDeconvolutionShapes(), framework::dataset::make("DataType", DataType::F32))),
77 input_shape, data_type)
78{
79 // Create shapes
Matthew Jacksonb9070a42019-08-22 16:13:27 +010080 const unsigned int kernel_size_x = 3;
81 const unsigned int kernel_size_y = 3;
82 const unsigned int num_kernels = 1;
83 const TensorShape weights_shape(kernel_size_x, kernel_size_y, input_shape.z(), num_kernels);
84 const TensorShape bias_shape(num_kernels);
85 const PadStrideInfo info(1, 1, 1, 1);
86 auto out_dim = deconvolution_output_dimensions(input_shape.x(), input_shape.y(), kernel_size_x, kernel_size_y, info);
87 TensorShape output_shape = compute_deconvolution_output_shape(out_dim, TensorInfo(input_shape, 1, data_type), TensorInfo(weights_shape, 1, data_type));
Alex Gilday27c08ab2018-02-22 11:36:16 +000088
89 // Create tensors
90 Tensor src = create_tensor<Tensor>(input_shape, data_type, 1);
91 Tensor weights = create_tensor<Tensor>(weights_shape, data_type, 1);
92 Tensor bias = create_tensor<Tensor>(bias_shape, data_type, 1);
93 Tensor dst = create_tensor<Tensor>(output_shape, data_type, 1);
94
95 ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
96 ARM_COMPUTE_EXPECT(weights.info()->is_resizable(), framework::LogLevel::ERRORS);
97 ARM_COMPUTE_EXPECT(bias.info()->is_resizable(), framework::LogLevel::ERRORS);
98 ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS);
99
100 // Create and configure function
101 NEDeconvolutionLayer deconv;
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100102 deconv.configure(&src, &weights, &bias, &dst, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL));
Alex Gilday27c08ab2018-02-22 11:36:16 +0000103
104 // Validate valid region
105 const ValidRegion src_valid_region = shape_to_valid_region(input_shape);
106 const ValidRegion weights_valid_region = shape_to_valid_region(weights_shape);
107 const ValidRegion bias_valid_region = shape_to_valid_region(bias_shape);
108 const ValidRegion dst_valid_region = shape_to_valid_region(output_shape);
109
110 validate(src.info()->valid_region(), src_valid_region);
111 validate(weights.info()->valid_region(), weights_valid_region);
112 validate(bias.info()->valid_region(), bias_valid_region);
113 validate(dst.info()->valid_region(), dst_valid_region);
114}
115
116// *INDENT-OFF*
117// clang-format off
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100118DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100119 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type
120 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape
121 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type
122 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape
123 TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
124 TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000125 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100126 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
127 TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
128 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
129 TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
130 TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
131 TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000132 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100133 framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16),
134 TensorInfo(TensorShape(1U), 1, DataType::F32),
135 TensorInfo(TensorShape(1U), 1, DataType::F32),
136 TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
137 TensorInfo(TensorShape(1U), 1, DataType::F32),
138 TensorInfo(TensorShape(4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000139 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100140 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
141 TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
142 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
143 TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
144 TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
145 TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000146 })),
147 framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
148 PadStrideInfo(1, 1, 0, 0),
149 PadStrideInfo(1, 1, 0, 0),
150 PadStrideInfo(1, 1, 0, 0),
151 PadStrideInfo(1, 1, 1, 1),
152 PadStrideInfo(1, 1, 0, 0),
153 })),
Alex Gilday27c08ab2018-02-22 11:36:16 +0000154 framework::dataset::make("Expected", { false, false, false, false, false, true })),
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100155 input_info, weights_info, bias_info, output_info, pad_info, expected)
Alex Gilday27c08ab2018-02-22 11:36:16 +0000156{
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100157 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 +0000158 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
159}
160// clang-format on
161// *INDENT-ON*
162
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100163template <typename T>
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100164using NEDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000165
166template <typename T>
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100167using NEDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100168
169template <typename T>
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100170using NEDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
171
172template <typename T>
173using NEDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100174
175TEST_SUITE(Float)
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100176TEST_SUITE(FP32)
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000177TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100178FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)),
179 data_layouts_dataset),
180 add_bias_dataset))
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000181{
182 // Validate output
183 validate(Accessor(_target), _reference, tolerance_fp32);
184}
Michalis Spyrou064add62018-11-01 18:14:27 +0000185TEST_SUITE_END() // W4x4
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100186TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100187FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
188 DataType::F32)),
189 data_layouts_dataset),
190 add_bias_dataset))
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100191{
192 // Validate output
193 validate(Accessor(_target), _reference, tolerance_fp32);
194}
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100195FIXTURE_DATA_TEST_CASE(RunAsymm, NEDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType",
196 DataType::F32)),
197 data_layouts_dataset),
198 add_bias_dataset))
199{
200 // Validate output
201 validate(Accessor(_target), _reference, tolerance_fp32);
202}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100203FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)),
204 data_layouts_dataset),
205 add_bias_dataset))
Michalis Spyrou064add62018-11-01 18:14:27 +0000206{
207 // Validate output
208 validate(Accessor(_target), _reference, tolerance_fp32);
209}
210TEST_SUITE_END() // W3x3
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100211TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100212FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)),
213 data_layouts_dataset),
214 add_bias_dataset))
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100215{
216 // Validate output
217 validate(Accessor(_target), _reference, tolerance_fp32);
218}
Michalis Spyrou064add62018-11-01 18:14:27 +0000219TEST_SUITE_END() // W1x1
Michalis Spyrou064add62018-11-01 18:14:27 +0000220TEST_SUITE_END() // FP32
Manuel Bottinif391fff2019-05-15 13:01:26 +0100221
222#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
223TEST_SUITE(FP16)
224TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100225FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)),
226 data_layouts_dataset),
227 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100228{
229 // Validate output
230 validate(Accessor(_target), _reference, tolerance_fp16);
231}
232TEST_SUITE_END() // W4x4
233TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100234FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
235 DataType::F16)),
236 data_layouts_dataset),
237 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100238{
239 // Validate output
240 validate(Accessor(_target), _reference, tolerance_fp16);
241}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100242FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)),
243 data_layouts_dataset),
244 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100245{
246 // Validate output
247 validate(Accessor(_target), _reference, tolerance_fp16);
248}
249TEST_SUITE_END() // W3x3
250TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100251FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)),
252 data_layouts_dataset),
253 add_bias_dataset))
Manuel Bottinif391fff2019-05-15 13:01:26 +0100254{
255 // Validate output
256 validate(Accessor(_target), _reference, tolerance_fp16);
257}
258TEST_SUITE_END() // W1x1
259TEST_SUITE_END() // FP16
260#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
261
Michalis Spyrou064add62018-11-01 18:14:27 +0000262TEST_SUITE_END() // Float
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100263
Usama Arif2899e002019-04-16 14:32:25 +0100264template <typename T>
265using NEDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 4, 4>;
266
267template <typename T>
268using NEDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 3, 3>;
269
270template <typename T>
271using NEDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<Tensor, Accessor, NEDeconvolutionLayer, T, 1, 1>;
272
273TEST_SUITE(Quantized)
274TEST_SUITE(QASYMM8)
275
276TEST_SUITE(W4x4)
Manuel Bottini279814b2019-10-25 10:28:28 +0100277FIXTURE_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 +0100278 DataType::QASYMM8)),
279 data_layouts_dataset),
Manuel Bottini279814b2019-10-25 10:28:28 +0100280 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
281 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100282 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100283{
284 // Validate output
285 validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num);
286}
287TEST_SUITE_END() // W4x4
288
289TEST_SUITE(W3x3)
Manuel Bottini279814b2019-10-25 10:28:28 +0100290FIXTURE_DATA_TEST_CASE(RunSmall, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100291 framework::dataset::make("DataType",
292 DataType::QASYMM8)),
Usama Arif2899e002019-04-16 14:32:25 +0100293 data_layouts_dataset),
Manuel Bottini279814b2019-10-25 10:28:28 +0100294 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
295 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100296 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100297{
298 // Validate output
299 validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num);
300}
Manuel Bottini279814b2019-10-25 10:28:28 +0100301FIXTURE_DATA_TEST_CASE(RunLarge, NEDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
302 framework::dataset::make("DataType",
303 DataType::QASYMM8)),
Usama Arif2899e002019-04-16 14:32:25 +0100304 data_layouts_dataset),
Manuel Bottini279814b2019-10-25 10:28:28 +0100305 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
306 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100307 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100308{
309 // Validate output
310 validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num);
311}
312TEST_SUITE_END() // W3x3
313
314TEST_SUITE(W1x1)
Manuel Bottini279814b2019-10-25 10:28:28 +0100315FIXTURE_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 +0100316 DataType::QASYMM8)),
317 data_layouts_dataset),
Manuel Bottini279814b2019-10-25 10:28:28 +0100318 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
319 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100320 add_bias_dataset))
Usama Arif2899e002019-04-16 14:32:25 +0100321{
322 // Validate output
323 validate(Accessor(_target), _reference, tolerance_qasymm8, tolerance_num);
324}
325TEST_SUITE_END() // W1x1
326
327TEST_SUITE_END() // QASYMM8
328TEST_SUITE_END() // Quantized
329
Michalis Spyrou064add62018-11-01 18:14:27 +0000330TEST_SUITE_END() // DeconvolutionLayer
331TEST_SUITE_END() // NEON
Pablo Tellof5f34bb2017-08-22 13:34:13 +0100332} // namespace validation
333} // namespace test
334} // namespace arm_compute