aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/CL/ChannelShuffle.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2019-01-10 17:19:50 +0000
committerMichalis Spyrou <michalis.spyrou@arm.com>2019-01-17 11:09:55 +0000
commit80943253e63779b61412264ff4c58b406cf061ae (patch)
tree1d1309d1c2a9ef5a6fceb21237f8117fd250f40a /tests/validation/CL/ChannelShuffle.cpp
parent57016a419c89e737216fd12711e6eba7e030061e (diff)
downloadComputeLibrary-80943253e63779b61412264ff4c58b406cf061ae.tar.gz
COMPMID-1652 CL Cleanup and add missing tests
Change-Id: I359cc0fd0c3fa42ab10a770e59d58704403889b2 Reviewed-on: https://review.mlplatform.org/498 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Diffstat (limited to 'tests/validation/CL/ChannelShuffle.cpp')
-rw-r--r--tests/validation/CL/ChannelShuffle.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/validation/CL/ChannelShuffle.cpp b/tests/validation/CL/ChannelShuffle.cpp
index c2373ff895..8b5a4f5484 100644
--- a/tests/validation/CL/ChannelShuffle.cpp
+++ b/tests/validation/CL/ChannelShuffle.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018 ARM Limited.
+ * Copyright (c) 2018-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -43,6 +43,33 @@ namespace validation
TEST_SUITE(CL)
TEST_SUITE(ChannelShuffle)
+// *INDENT-OFF*
+// clang-format off
+DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
+ framework::dataset::make("InputInfo", { TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32), // Invalid num groups
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::U8), // Mismatching data_type
+ TensorInfo(TensorShape(4U, 5U, 4U), 1, DataType::F32), // Mismatching shapes
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32), // Num groups == channels
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32), // (channels % num_groups) != 0
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32), // Valid
+ }),
+ framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ TensorInfo(TensorShape(4U, 4U, 4U), 1, DataType::F32),
+ })),
+ framework::dataset::make("NumGroups",{ 1, 2, 2, 4, 3, 2,
+ })),
+ framework::dataset::make("Expected", { false, false, false, false, false, true})),
+ input_info, output_info, num_groups, expected)
+{
+ ARM_COMPUTE_EXPECT(bool(CLChannelShuffleLayer::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), num_groups)) == expected, framework::LogLevel::ERRORS);
+}
+// clang-format on
+// *INDENT-ON*
+
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallRandomChannelShuffleLayerDataset(), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })),
shape, num_groups, data_type)
{