diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/benchmark/fixtures/DepthConcatenateLayerFixture.h | 3 | ||||
-rw-r--r-- | tests/validation/CL/DepthConcatenateLayer.cpp | 38 | ||||
-rw-r--r-- | tests/validation/fixtures/DepthConcatenateLayerFixture.h | 3 |
3 files changed, 42 insertions, 2 deletions
diff --git a/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h b/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h index 292adde49f..7f7ed8b20b 100644 --- a/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h +++ b/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h @@ -27,6 +27,7 @@ #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Utils.h" +#include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "tests/AssetsLibrary.h" #include "tests/Globals.h" #include "tests/Utils.h" @@ -99,7 +100,7 @@ public: src_ptrs.emplace_back(&_srcs.back()); } - TensorShape dst_shape = calculate_depth_concatenate_shape(src_ptrs); + TensorShape dst_shape = misc::shape_calculator::calculate_depth_concatenate_shape(src_ptrs); _dst = create_tensor<TensorType>(dst_shape, data_type, 1); _depth_concat.configure(src_ptrs, &_dst); diff --git a/tests/validation/CL/DepthConcatenateLayer.cpp b/tests/validation/CL/DepthConcatenateLayer.cpp index f5a5c230af..a9346dce7d 100644 --- a/tests/validation/CL/DepthConcatenateLayer.cpp +++ b/tests/validation/CL/DepthConcatenateLayer.cpp @@ -42,6 +42,44 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(DepthConcatenateLayer) +// *INDENT-OFF* +// clang-format off +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( + framework::dataset::make("InputInfo1", { TensorInfo(TensorShape(23U, 27U, 5U), 1, DataType::F32), // Mismatching data type input/output + TensorInfo(TensorShape(24U, 27U, 4U), 1, DataType::F32), // Mismatching x dimension + TensorInfo(TensorShape(23U, 27U, 3U), 1, DataType::F32), // Mismatching total depth + TensorInfo(TensorShape(16U, 27U, 6U), 1, DataType::F32) + }), + framework::dataset::make("InputInfo2", { TensorInfo(TensorShape(23U, 27U, 4U), 1, DataType::F32), + TensorInfo(TensorShape(23U, 27U, 5U), 1, DataType::F32), + TensorInfo(TensorShape(23U, 27U, 4U), 1, DataType::F32), + TensorInfo(TensorShape(16U, 27U, 6U), 1, DataType::F32) + })), + framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(23U, 27U, 9U), 1, DataType::F16), + TensorInfo(TensorShape(25U, 12U, 9U), 1, DataType::F32), + TensorInfo(TensorShape(23U, 27U, 8U), 1, DataType::F32), + TensorInfo(TensorShape(16U, 27U, 12U), 1, DataType::F32) + })), + framework::dataset::make("Expected", { false, false, false, true })), + input_info1, input_info2, output_info,expected) +{ + std::vector<TensorInfo> inputs_vector_info; + inputs_vector_info.emplace_back(std::move(input_info1)); + inputs_vector_info.emplace_back(std::move(input_info2)); + + std::vector<ITensorInfo *> inputs_vector_info_raw; + for(auto &input : inputs_vector_info) + { + inputs_vector_info_raw.emplace_back(&input); + } + + bool is_valid = bool(CLDepthConcatenateLayer::validate(inputs_vector_info_raw, + &output_info.clone()->set_is_resizable(false))); + ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); +} +// clang-format on +// *INDENT-ON* + TEST_CASE(Configuration, framework::DatasetMode::ALL) { // Create tensors diff --git a/tests/validation/fixtures/DepthConcatenateLayerFixture.h b/tests/validation/fixtures/DepthConcatenateLayerFixture.h index 76b56ad26e..5fdfacbb76 100644 --- a/tests/validation/fixtures/DepthConcatenateLayerFixture.h +++ b/tests/validation/fixtures/DepthConcatenateLayerFixture.h @@ -26,6 +26,7 @@ #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/Types.h" +#include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "tests/AssetsLibrary.h" #include "tests/Globals.h" #include "tests/IAccessor.h" @@ -106,7 +107,7 @@ protected: src_ptrs.emplace_back(&srcs.back()); } - TensorShape dst_shape = calculate_depth_concatenate_shape(shapes); + TensorShape dst_shape = misc::shape_calculator::calculate_depth_concatenate_shape(src_ptrs); TensorType dst = create_tensor<TensorType>(dst_shape, data_type, 1); // Create and configure function |