diff options
4 files changed, 48 insertions, 4 deletions
diff --git a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp index 05b5d54cf7..26d46a438c 100644 --- a/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp +++ b/src/runtime/CL/functions/CLDepthConcatenateLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -64,6 +64,9 @@ void CLDepthConcatenateLayer::configure(std::vector<ICLTensor *> inputs_vector, depth_offset += inputs_vector.at(i)->info()->dimension(2); } + + // Set valid region from shape + output->info()->set_valid_region(ValidRegion(Coordinates(), output_shape)); } void CLDepthConcatenateLayer::run() diff --git a/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp b/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp index 437c9417ce..930f8d5a26 100644 --- a/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp +++ b/src/runtime/NEON/functions/NEDepthConcatenateLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -62,6 +62,9 @@ void NEDepthConcatenateLayer::configure(std::vector<ITensor *> inputs_vector, IT depth_offset += inputs_vector.at(i)->info()->dimension(2); } + + // Set valid region from shape + output->info()->set_valid_region(ValidRegion(Coordinates(), output_shape)); } void NEDepthConcatenateLayer::run() diff --git a/tests/validation/CL/DepthConcatenateLayer.cpp b/tests/validation/CL/DepthConcatenateLayer.cpp index 756499278a..725af88a17 100644 --- a/tests/validation/CL/DepthConcatenateLayer.cpp +++ b/tests/validation/CL/DepthConcatenateLayer.cpp @@ -42,7 +42,26 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(DepthConcatenateLayer) -//TODO(COMPMID-415): Add configuration test? +TEST_CASE(Configuration, framework::DatasetMode::ALL) +{ + // Create tensors + CLTensor src1 = create_tensor<CLTensor>(TensorShape(32U, 32U, 128U), DataType::F32, 1); + CLTensor src2 = create_tensor<CLTensor>(TensorShape(32U, 32U, 32U), DataType::F32, 1); + CLTensor dst; + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + CLDepthConcatenateLayer concat_layer; + + concat_layer.configure({ &src1, &src2 }, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(TensorShape(32U, 32U, 160U)); + validate(dst.info()->valid_region(), valid_region); +} template <typename T> using CLDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture<CLTensor, ICLTensor, CLAccessor, CLDepthConcatenateLayer, T>; diff --git a/tests/validation/NEON/DepthConcatenateLayer.cpp b/tests/validation/NEON/DepthConcatenateLayer.cpp index 581f6249bf..c3bb8a93b7 100644 --- a/tests/validation/NEON/DepthConcatenateLayer.cpp +++ b/tests/validation/NEON/DepthConcatenateLayer.cpp @@ -42,7 +42,26 @@ namespace validation TEST_SUITE(NEON) TEST_SUITE(DepthConcatenateLayer) -//TODO(COMPMID-415): Add configuration test? +TEST_CASE(Configuration, framework::DatasetMode::ALL) +{ + // Create tensors + Tensor src1 = create_tensor<Tensor>(TensorShape(32U, 32U, 128U), DataType::F32, 1); + Tensor src2 = create_tensor<Tensor>(TensorShape(32U, 32U, 32U), DataType::F32, 1); + Tensor dst; + + ARM_COMPUTE_EXPECT(src1.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(src2.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + + // Create and configure function + NEDepthConcatenateLayer concat_layer; + + concat_layer.configure({ &src1, &src2 }, &dst); + + // Validate valid region + const ValidRegion valid_region = shape_to_valid_region(TensorShape(32U, 32U, 160U)); + validate(dst.info()->valid_region(), valid_region); +} template <typename T> using NEDepthConcatenateLayerFixture = DepthConcatenateLayerValidationFixture<Tensor, ITensor, Accessor, NEDepthConcatenateLayer, T>; |