diff options
author | SiCong Li <sicong.li@arm.com> | 2023-03-21 12:00:15 +0000 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2023-03-27 12:56:26 +0000 |
commit | 5a7d1571a2de24eefc6f1d8d22deeef9f47521ee (patch) | |
tree | 1a9610a60f468619aa54acd4454ace59d83b5b88 /src | |
parent | b531b7549abdd5c10b14b00107ea647591baa430 (diff) | |
download | ComputeLibrary-5a7d1571a2de24eefc6f1d8d22deeef9f47521ee.tar.gz |
Fix BatchToSpaceFixture
* Use a vector to represent the (static) block shape instead of an N-D
Tensor. The previous use of ND Tensor as block shape was wrong, not
adhering to the specification, and non-functional (only first dim was
used anyway).
* The fixture now accepts a static block shape, because the dynamic
case is not properly implemented and will be deprecated for now.
* Fix an assertion error in reference implementation.
Partially resolves COMPMID-5918
Change-Id: I5221e52ccc05e7c1249dec3a42426f954a73729a
Signed-off-by: SiCong Li <sicong.li@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9357
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com>
Reviewed-by: Omar Al Khatib <omar.alkhatib@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/CL/kernels/CLBatchToSpaceLayerKernel.cpp | 6 | ||||
-rw-r--r-- | src/core/NEON/kernels/NEBatchToSpaceLayerKernel.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/core/CL/kernels/CLBatchToSpaceLayerKernel.cpp b/src/core/CL/kernels/CLBatchToSpaceLayerKernel.cpp index 6f333dd925..b47d5a7e38 100644 --- a/src/core/CL/kernels/CLBatchToSpaceLayerKernel.cpp +++ b/src/core/CL/kernels/CLBatchToSpaceLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Arm Limited. + * Copyright (c) 2018-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -128,8 +128,8 @@ void CLBatchToSpaceLayerKernel::configure(const CLCompileContext &compile_contex { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - TensorShape output_shape = compute_batch_to_space_shape(input->info(), block_shape_x, block_shape_y); - auto_init_if_empty(*output->info(), output_shape, 1, input->info()->data_type()); + const TensorShape output_shape = compute_batch_to_space_shape(input->info()->data_layout(), input->info()->tensor_shape(), block_shape_x, block_shape_y); + auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape)); ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_static(input->info(), block_shape_x, block_shape_y, output->info())); diff --git a/src/core/NEON/kernels/NEBatchToSpaceLayerKernel.cpp b/src/core/NEON/kernels/NEBatchToSpaceLayerKernel.cpp index 10207b9cf6..84c727df73 100644 --- a/src/core/NEON/kernels/NEBatchToSpaceLayerKernel.cpp +++ b/src/core/NEON/kernels/NEBatchToSpaceLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2020, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -103,7 +103,7 @@ void NEBatchToSpaceLayerKernel::configure(const ITensor *input, const ITensor *b void NEBatchToSpaceLayerKernel::configure(const ITensor *input, const int32_t block_shape_x, const int32_t block_shape_y, ITensor *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - TensorShape output_shape = compute_batch_to_space_shape(input->info(), block_shape_x, block_shape_y); + const TensorShape output_shape = compute_batch_to_space_shape(input->info()->data_layout(), input->info()->tensor_shape(), block_shape_x, block_shape_y); // Output auto inizialitation if not yet initialized auto_init_if_empty(*output->info(), input->info()->clone()->set_tensor_shape(output_shape)); |