aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-12-07 16:47:52 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit358ca205c9e41f523517ffa55a9057308b736040 (patch)
tree5d86460e73e9ad99837ae0c9c903448592d8c848 /tests
parenteb8f71eecbc44e64cd7814f53b27b42c43dd660b (diff)
downloadComputeLibrary-358ca205c9e41f523517ffa55a9057308b736040.tar.gz
COMPMID-617: Adds CLFullyConnectionLayer validation support
Change-Id: I4d2eb9872a3165fdcaa7784596e441cbe563dbc2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112577 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Ioan-Cristian Szabo <ioan-cristian.szabo@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/validation/CL/FullyConnectedLayer.cpp51
-rw-r--r--tests/validation/NEON/Col2Im.cpp4
-rw-r--r--tests/validation/NEON/Im2Col.cpp4
3 files changed, 55 insertions, 4 deletions
diff --git a/tests/validation/CL/FullyConnectedLayer.cpp b/tests/validation/CL/FullyConnectedLayer.cpp
index 0d8c8774b8..aba92f14d8 100644
--- a/tests/validation/CL/FullyConnectedLayer.cpp
+++ b/tests/validation/CL/FullyConnectedLayer.cpp
@@ -115,6 +115,57 @@ DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(frame
ARM_COMPUTE_EXPECT(weights.info()->quantization_info() == weights_quantization_info, framework::LogLevel::ERRORS);
}
+// *INDENT-OFF*
+// clang-format off
+DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
+ framework::dataset::make("InputInfo", { TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Mismatching data types
+ TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::QS8, 2), // Mismatching fixed point position
+ TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Invalid weights dimensions
+ TensorInfo(TensorShape(9U, 5U, 7U, 3U), 1, DataType::F32), // Wrongly reshaped weights
+ TensorInfo(TensorShape(8U, 4U, 6U, 4U), 1, DataType::F32),
+ }),
+ framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(315U, 271U), 1, DataType::F16),
+ TensorInfo(TensorShape(315U, 271U), 1, DataType::QS8, 3),
+ TensorInfo(TensorShape(192U, 192U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U, 192U), 1, DataType::F32),
+ TensorInfo(TensorShape(217U, 315U), 1, DataType::F32),
+ TensorInfo(TensorShape(217U, 315U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U, 192U), 1, DataType::F32),
+ })),
+ framework::dataset::make("BiasInfo",{ TensorInfo(TensorShape(271U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U), 1, DataType::QS8, 2),
+ TensorInfo(TensorShape(192U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U), 1, DataType::F32),
+ })),
+ framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(271U, 3U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U, 3U), 1, DataType::QS8, 3),
+ TensorInfo(TensorShape(192U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U, 3U), 1, DataType::F32),
+ TensorInfo(TensorShape(271U, 3U), 1, DataType::F32),
+ TensorInfo(TensorShape(192U, 4U), 1, DataType::F32),
+ })),
+ framework::dataset::make("TransposeWeights",{ true, true, true, false, true, true, true })),
+ framework::dataset::make("ReshapedWeights",{ false, false, false, false, false, false , false})),
+ framework::dataset::make("Expected", { false, false, true, true, false, false, true })),
+ input_info, weights_info, bias_info, output_info, transpose_weights, reshaped_weights, expected)
+{
+ Status status = CLFullyConnectedLayer::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),
+ transpose_weights,
+ reshaped_weights);
+ ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS);
+}
+// clang-format on
+// *INDENT-ON*
+
template <typename T>
using CLFullyConnectedLayerFixture = FullyConnectedLayerValidationFixture<CLTensor, CLAccessor, CLFullyConnectedLayer, T, false>;
diff --git a/tests/validation/NEON/Col2Im.cpp b/tests/validation/NEON/Col2Im.cpp
index 9125dc2498..9f2415d628 100644
--- a/tests/validation/NEON/Col2Im.cpp
+++ b/tests/validation/NEON/Col2Im.cpp
@@ -58,8 +58,8 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(
framework::dataset::make("Expected", { false, false, false, false, true })),
input_info, output_info, convolved_width, convolved_height, expected)
{
- bool err = bool(NECol2Im::validate(&input_info, &output_info, Size2D(convolved_width, convolved_height)));
- ARM_COMPUTE_EXPECT(err == expected, framework::LogLevel::ERRORS);
+ bool status = bool(NECol2Im::validate(&input_info, &output_info, Size2D(convolved_width, convolved_height)));
+ ARM_COMPUTE_EXPECT(status == expected, framework::LogLevel::ERRORS);
}
// clang-format on
// *INDENT-ON*
diff --git a/tests/validation/NEON/Im2Col.cpp b/tests/validation/NEON/Im2Col.cpp
index 4faa7d7d66..f8e474b6c3 100644
--- a/tests/validation/NEON/Im2Col.cpp
+++ b/tests/validation/NEON/Im2Col.cpp
@@ -56,8 +56,8 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
framework::dataset::make("Expected", { false, false, false, false, true })),
input_info, output_info, has_bias, expected)
{
- bool err = bool(NEIm2Col::validate(&input_info, &output_info, Size2D(3U, 3U), PadStrideInfo(), has_bias));
- ARM_COMPUTE_EXPECT(err == expected, framework::LogLevel::ERRORS);
+ bool status = bool(NEIm2Col::validate(&input_info, &output_info, Size2D(3U, 3U), PadStrideInfo(), has_bias));
+ ARM_COMPUTE_EXPECT(status == expected, framework::LogLevel::ERRORS);
}
// clang-format on
// *INDENT-ON*