aboutsummaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/CL/DeconvolutionLayer.cpp179
-rw-r--r--tests/validation/NEON/DeconvolutionLayer.cpp29
-rw-r--r--tests/validation/fixtures/DeconvolutionLayerFixture.h3
-rw-r--r--tests/validation/reference/DeconvolutionLayer.cpp1
4 files changed, 169 insertions, 43 deletions
diff --git a/tests/validation/CL/DeconvolutionLayer.cpp b/tests/validation/CL/DeconvolutionLayer.cpp
index c284cdcee3..15962b588d 100644
--- a/tests/validation/CL/DeconvolutionLayer.cpp
+++ b/tests/validation/CL/DeconvolutionLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -87,34 +87,34 @@ TEST_SUITE(DeconvolutionLayer)
// *INDENT-OFF*
// clang-format off
DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
- framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type
- TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape
- TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type
- TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape
- TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
- TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
- }),
+ framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape
+ TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
+ TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
+ }),
framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
- TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
- TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
- TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
- TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
+ TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
+ TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
- })),
- framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16),
- TensorInfo(TensorShape(1U), 1, DataType::F32),
- TensorInfo(TensorShape(1U), 1, DataType::F32),
- TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
- TensorInfo(TensorShape(1U), 1, DataType::F32),
- TensorInfo(TensorShape(4U), 1, DataType::F32),
- })),
- framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
- TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
- TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
- TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
- TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
- TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
- })),
+ })),
+ framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16),
+ TensorInfo(TensorShape(1U), 1, DataType::F32),
+ TensorInfo(TensorShape(1U), 1, DataType::F32),
+ TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
+ TensorInfo(TensorShape(1U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U), 1, DataType::F32),
+ })),
+ framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
+ TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
+ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
+ TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
+ TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
+ TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
+ })),
framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(1, 1, 0, 0),
@@ -286,6 +286,18 @@ using CLDeconvolutionLayerQuantizedFixture2x2 = DeconvolutionValidationQuantized
template <typename T>
using CLDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>;
+template <typename T>
+using CLDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 4, 4>;
+
+template <typename T>
+using CLDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 3, 3>;
+
+template <typename T>
+using CLDeconvolutionLayerQuantizedPerChannelFixture2x2 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 2, 2>;
+
+template <typename T>
+using CLDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 1, 1>;
+
TEST_SUITE(Quantized)
TEST_SUITE(QASYMM8)
@@ -414,8 +426,8 @@ FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<int8_t>
TEST_SUITE_END() // W2x2
TEST_SUITE(W1x1) // DirectDeconvolution and GEMMDeconvolution
-FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType",
- DataType::QASYMM8_SIGNED)),
+FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1,
+ framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
data_layouts_dataset),
framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
@@ -428,6 +440,115 @@ TEST_SUITE_END() // W1x1
TEST_SUITE_END() // QASYMM8_SIGNED
+const auto input_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) });
+const auto output_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) });
+const auto input_signed_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) });
+const auto output_signed_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) });
+
+TEST_SUITE(QSYMM8_PER_CHANNEL)
+
+TEST_SUITE(W4x4)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
+ framework::dataset::make("DataType", DataType::QASYMM8)),
+ data_layouts_dataset),
+ input_qinfo_dataset),
+ output_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
+ framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
+ data_layouts_dataset),
+ input_signed_qinfo_dataset),
+ output_signed_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+TEST_SUITE_END() // W4x4
+
+TEST_SUITE(W3x3)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
+ framework::dataset::make("DataType", DataType::QASYMM8)),
+ data_layouts_dataset),
+ input_qinfo_dataset),
+ output_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
+ framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
+ data_layouts_dataset),
+ input_signed_qinfo_dataset),
+ output_signed_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+TEST_SUITE_END() // W3x3
+
+TEST_SUITE(W2x2)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data2x2_precommit,
+ framework::dataset::make("DataType", DataType::QASYMM8)),
+ data_layouts_dataset),
+ input_qinfo_dataset),
+ output_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data2x2_precommit,
+ framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
+ data_layouts_dataset),
+ input_signed_qinfo_dataset),
+ output_signed_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+TEST_SUITE_END() // W2x2
+
+TEST_SUITE(W1x1)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
+ framework::dataset::make("DataType", DataType::QASYMM8)),
+ data_layouts_dataset),
+ input_qinfo_dataset),
+ output_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
+ framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
+ data_layouts_dataset),
+ input_signed_qinfo_dataset),
+ output_signed_qinfo_dataset),
+ add_bias_dataset),
+ framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
+{
+ // Validate output
+ validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
+}
+TEST_SUITE_END() // W1x1
+
+TEST_SUITE_END() // QSYMM8_PER_CHANNEL
+
TEST_SUITE_END() // Quantized
TEST_SUITE_END() // DeconvolutionLayer
diff --git a/tests/validation/NEON/DeconvolutionLayer.cpp b/tests/validation/NEON/DeconvolutionLayer.cpp
index 4c6ee2615d..19bd742a61 100644
--- a/tests/validation/NEON/DeconvolutionLayer.cpp
+++ b/tests/validation/NEON/DeconvolutionLayer.cpp
@@ -395,14 +395,19 @@ TEST_SUITE_END() // W1x1
TEST_SUITE_END() // QASYMM8_SIGNED
+const auto input_qinfo_per_channel_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) });
+const auto output_qinfo_per_channel_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) });
+const auto input_signed_qinfo_per_channel_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) });
+const auto output_signed_qinfo_per_channel_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) });
+
TEST_SUITE(QSYMM8_PER_CHANNEL)
TEST_SUITE(W4x4)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
framework::dataset::make("DataType", DataType::QASYMM8)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_qinfo_per_channel_dataset),
+ output_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
@@ -412,8 +417,8 @@ FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<ui
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data4x4,
framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_signed_qinfo_per_channel_dataset),
+ output_signed_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
@@ -426,8 +431,8 @@ TEST_SUITE(W3x3)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
framework::dataset::make("DataType", DataType::QASYMM8)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_qinfo_per_channel_dataset),
+ output_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
@@ -437,8 +442,8 @@ FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<ui
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data3x3,
framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_signed_qinfo_per_channel_dataset),
+ output_signed_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
@@ -451,8 +456,8 @@ TEST_SUITE(W1x1)
FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
framework::dataset::make("DataType", DataType::QASYMM8)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_qinfo_per_channel_dataset),
+ output_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
@@ -462,8 +467,8 @@ FIXTURE_DATA_TEST_CASE(Run, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<ui
FIXTURE_DATA_TEST_CASE(RunSigned, NEDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(data1x1,
framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
data_layouts_dataset),
- input_qinfo_dataset),
- output_qinfo_dataset),
+ input_signed_qinfo_per_channel_dataset),
+ output_signed_qinfo_per_channel_dataset),
add_bias_dataset),
framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
{
diff --git a/tests/validation/fixtures/DeconvolutionLayerFixture.h b/tests/validation/fixtures/DeconvolutionLayerFixture.h
index 4bc1d3bb45..7c06635bcd 100644
--- a/tests/validation/fixtures/DeconvolutionLayerFixture.h
+++ b/tests/validation/fixtures/DeconvolutionLayerFixture.h
@@ -136,8 +136,7 @@ protected:
{
case DataType::S32:
{
- const int32_t value = static_cast<int32_t>(tensor.quantization_info().uniform().offset);
- library->fill_tensor_value(tensor, value);
+ library->fill_tensor_value(tensor, 0);
break;
}
case DataType::F16:
diff --git a/tests/validation/reference/DeconvolutionLayer.cpp b/tests/validation/reference/DeconvolutionLayer.cpp
index afbf063e63..eeb25fcbe3 100644
--- a/tests/validation/reference/DeconvolutionLayer.cpp
+++ b/tests/validation/reference/DeconvolutionLayer.cpp
@@ -24,6 +24,7 @@
#include "ConvolutionLayer.h"
#include "tests/validation/Helpers.h"
+
namespace arm_compute
{
namespace test