diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/datasets/ShapeDatasets.h | 12 | ||||
-rw-r--r-- | tests/validation/CL/ReduceMean.cpp | 22 | ||||
-rw-r--r-- | tests/validation/NEON/ReduceMean.cpp | 22 |
3 files changed, 36 insertions, 20 deletions
diff --git a/tests/datasets/ShapeDatasets.h b/tests/datasets/ShapeDatasets.h index 07ecf45d81..b479eb4953 100644 --- a/tests/datasets/ShapeDatasets.h +++ b/tests/datasets/ShapeDatasets.h @@ -203,7 +203,9 @@ public: TensorShape{ 128U, 1U, 5U, 3U }, TensorShape{ 9U, 9U, 3U, 4U }, TensorShape{ 27U, 13U, 2U, 4U }, - TensorShape{ 1U, 1U, 1U, 5U } + TensorShape{ 1U, 1U, 1U, 5U }, + TensorShape{ 1U, 16U, 10U, 2U, 128U }, + TensorShape{ 1U, 16U, 10U, 2U, 128U } }), ShapeDataset("Shape1", { @@ -212,7 +214,9 @@ public: TensorShape{ 128U, 64U, 1U, 3U }, TensorShape{ 9U, 1U, 3U }, TensorShape{ 1U }, - TensorShape{ 9U, 9U, 3U, 5U } + TensorShape{ 9U, 9U, 3U, 5U }, + TensorShape{ 1U, 1U, 1U, 1U, 128U }, + TensorShape{ 128U } })) { } @@ -686,7 +690,7 @@ public: : ShapeDataset("InputShape", { // Batch size 1 - TensorShape{ 32U, 37U, 3U }, + TensorShape{ 32U, 37U, 3U }, // Batch size 4 TensorShape{ 32U, 37U, 3U, 4U }, }) @@ -702,7 +706,7 @@ public: : ShapeDataset("InputShape", { // Batch size 1 - TensorShape{ 32U, 37U, 3U }, + TensorShape{ 32U, 37U, 3U }, // Batch size 4 TensorShape{ 32U, 37U, 3U, 4U }, // Arbitrary batch size diff --git a/tests/validation/CL/ReduceMean.cpp b/tests/validation/CL/ReduceMean.cpp index cfd4a2730c..1b7400bf53 100644 --- a/tests/validation/CL/ReduceMean.cpp +++ b/tests/validation/CL/ReduceMean.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -55,20 +55,26 @@ TEST_SUITE(ReduceMean) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 3U, 16U, 2U), 1, DataType::F32), // Invalid axis TensorInfo(TensorShape(27U, 3U, 16U, 2U), 1, DataType::F32), // Invalid output shape - TensorInfo(TensorShape(32U, 16U, 16U, 2U), 1, DataType::F32) + TensorInfo(TensorShape(32U, 16U, 16U, 2U), 1, DataType::F32),// OK + TensorInfo(TensorShape{228U, 19U, 2U, 2U}, 1, DataType::F32),// OK + TensorInfo(TensorShape{228U, 19U, 2U, 1U}, 1, DataType::F32) // Cannot support axis 3 not valid }), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(27U, 3U, 1U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 3U, 1U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 16U, 1U, 2U), 1, DataType::F32) + TensorInfo(TensorShape(32U, 16U, 1U, 2U), 1, DataType::F32), + TensorInfo(TensorShape(19U), 1, DataType::F32), + TensorInfo(TensorShape(19U), 1, DataType::F32) + })), - framework::dataset::make("Axis", { Coordinates(4), Coordinates(0,2), Coordinates(2) })), - framework::dataset::make("Expected", { false, false, true })), - input_info, output_info, axis, expected) + framework::dataset::make("Axis", { Coordinates(4), Coordinates(0,2), Coordinates(2), Coordinates(3,2,0), Coordinates(3,2,0) })), + framework::dataset::make("Keep", { true, true, true, false, false })), + framework::dataset::make("Expected", { false, false, true, true, false })), + input_info, output_info, axis, keep, expected) { - const Status status = CLReduceMean::validate(&input_info.clone()->set_is_resizable(false), axis, true, &output_info.clone()->set_is_resizable(false)); + const Status status = CLReduceMean::validate(&input_info.clone()->set_is_resizable(false), axis, keep, &output_info.clone()->set_is_resizable(false)); ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); } // clang-format on diff --git a/tests/validation/NEON/ReduceMean.cpp b/tests/validation/NEON/ReduceMean.cpp index 3cd7ce362e..6d0caf7160 100644 --- a/tests/validation/NEON/ReduceMean.cpp +++ b/tests/validation/NEON/ReduceMean.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -57,20 +57,26 @@ TEST_SUITE(ReduceMean) // *INDENT-OFF* // clang-format off -DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 3U, 16U, 2U), 1, DataType::F32), // Invalid axis TensorInfo(TensorShape(27U, 3U, 16U, 2U), 1, DataType::F32), // Invalid output shape - TensorInfo(TensorShape(32U, 16U, 16U, 2U), 1, DataType::F32) + TensorInfo(TensorShape(32U, 16U, 16U, 2U), 1, DataType::F32),// OK + TensorInfo(TensorShape{228U, 19U, 2U, 2U}, 1, DataType::F32),// OK + TensorInfo(TensorShape{228U, 19U, 2U, 1U}, 1, DataType::F32) // Cannot support axis 3 not valid }), framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(27U, 3U, 1U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 3U, 1U, 2U), 1, DataType::F32), - TensorInfo(TensorShape(32U, 16U, 1U, 2U), 1, DataType::F32) + TensorInfo(TensorShape(32U, 16U, 1U, 2U), 1, DataType::F32), + TensorInfo(TensorShape(19U), 1, DataType::F32), + TensorInfo(TensorShape(19U), 1, DataType::F32) + })), - framework::dataset::make("Axis", { Coordinates(4), Coordinates(0,2), Coordinates(2) })), - framework::dataset::make("Expected", { false, false, true })), - input_info, output_info, axis, expected) + framework::dataset::make("Axis", { Coordinates(4), Coordinates(0,2), Coordinates(2), Coordinates(3,2,0), Coordinates(3,2,0) })), + framework::dataset::make("Keep", { true, true, true, false, false })), + framework::dataset::make("Expected", { false, false, true, true, false })), + input_info, output_info, axis, keep, expected) { - const Status status = NEReduceMean::validate(&input_info.clone()->set_is_resizable(false), axis, true, &output_info.clone()->set_is_resizable(false)); + const Status status = NEReduceMean::validate(&input_info.clone()->set_is_resizable(false), axis, keep, &output_info.clone()->set_is_resizable(false)); ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); } // clang-format on |