diff options
author | Isabella Gottardi <isabella.gottardi@arm.com> | 2018-09-03 12:17:47 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 553b999ccc4233b163377e0a55e2377614899a3e (patch) | |
tree | 77ab94ad2acac7d484555007a40a11a252b53d56 /tests/validation/CL/Scale.cpp | |
parent | aa6a04a56f21ab8de23b24c5f9ee7cafeaef8320 (diff) | |
download | ComputeLibrary-553b999ccc4233b163377e0a55e2377614899a3e.tar.gz |
COMPMID-1517 - Add validate method to CLScale
Change-Id: I36b119f27c87e2ce3d82a46089a29e298509772c
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/146625
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Diffstat (limited to 'tests/validation/CL/Scale.cpp')
-rw-r--r-- | tests/validation/CL/Scale.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/validation/CL/Scale.cpp b/tests/validation/CL/Scale.cpp index ddc93d045f..92d4f96c6a 100644 --- a/tests/validation/CL/Scale.cpp +++ b/tests/validation/CL/Scale.cpp @@ -69,6 +69,57 @@ constexpr float tolerance_num_f32(0.01f); TEST_SUITE(CL) TEST_SUITE(Scale) +// *INDENT-OFF* +// clang-format off + +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( + framework::dataset::make("InputInfo",{ TensorInfo(TensorShape(28U, 32U, 2U), 1, DataType::F16), + TensorInfo(TensorShape(28U, 32U, 2U), 1, DataType::F32), + TensorInfo(TensorShape(36U, 36U, 2U, 4U), 1, DataType::U8), + TensorInfo(TensorShape(40U, 35U, 2U, 4U), 1, DataType::S16), + TensorInfo(TensorShape(37U, 37U, 2U), 1, DataType::F32), // window shrink + TensorInfo(TensorShape(128U, 64U, 1U, 3U), 1, DataType::QASYMM8), // not supported + TensorInfo(TensorShape(37U, 37U, 3U, 4U), 1, DataType::F32), // mismatching datatype + TensorInfo(TensorShape(28U, 33U, 2U), 1, DataType::F32), // policy area, scale factor not correct + }), + framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 68U, 2U), 1, DataType::F16), + TensorInfo(TensorShape(40U, 56U, 2U), 1, DataType::F32), + TensorInfo(TensorShape(40U, 76U, 2U, 4U), 1, DataType::U8), + TensorInfo(TensorShape(28U, 32U, 2U, 4U), 1, DataType::S16), + TensorInfo(TensorShape(39U, 55U, 2U), 1, DataType::F32), // window shrink + TensorInfo(TensorShape(137U, 134U, 1U, 3U), 1, DataType::QASYMM8), // not supported + TensorInfo(TensorShape(39U, 77U, 3U, 4U), 1, DataType::F16), // mismatching datatype + TensorInfo(TensorShape(26U, 21U, 2U), 1, DataType::F32), // policy area, scale factor not correct + })), + framework::dataset::make("Policy",{ InterpolationPolicy::BILINEAR, + InterpolationPolicy::BILINEAR, + InterpolationPolicy::NEAREST_NEIGHBOR, + InterpolationPolicy::NEAREST_NEIGHBOR, + InterpolationPolicy::NEAREST_NEIGHBOR, + InterpolationPolicy::BILINEAR, + InterpolationPolicy::BILINEAR, + InterpolationPolicy::AREA, + })), + framework::dataset::make("BorderMode",{ BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + BorderMode::UNDEFINED, + })), + framework::dataset::make("Expected", { true, true, true, true, false, false, false, false })), +input_info, output_info, policy, border_mode, expected) +{ + Status status = CLScale::validate(&input_info.clone()->set_is_resizable(false), + &output_info.clone()->set_is_resizable(false), policy, border_mode); + ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); +} + +// clang-format on +// *INDENT-ON* + DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(combine(combine(concat(datasets::MediumShapes(), datasets::LargeShapes()), ScaleDataTypes), framework::dataset::make("InterpolationPolicy", { InterpolationPolicy::NEAREST_NEIGHBOR, InterpolationPolicy::BILINEAR })), datasets::BorderModes()), |