aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Dimensions.h
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2020-12-08 14:34:00 +0000
committerGiorgio Arena <giorgio.arena@arm.com>2020-12-10 18:55:25 +0000
commit15bc8485ef463508838a549b7e8518bf05883155 (patch)
tree3c9beb3956c9cf4eae95b09ef678cb4bb0506a9e /arm_compute/core/Dimensions.h
parent63bb7ca40e30b2db48d7bdd1adbc8223b53ac23c (diff)
downloadComputeLibrary-15bc8485ef463508838a549b7e8518bf05883155.tar.gz
[Review Shape] CLDepthwiseConvolutionLayer mismatches
- Fixed a bug that corrected the number of dimensions of a TensorShape for added trailing 1s - Avoided adding offset_first_element for the Depthwise 3x3 NCHW OpenCL kernels, since it wouldn't align with the window which is based on the output - Adjusted padding requirements along the x for Depthwise 3x3 NCHW. The kernel should always add 2 * dilation_(x/y) to the num_elems_read_x/y - Adjusted the kernel's border_size given to the border handler at function level - Added the dataset that previously made the tests fail Resolves: COMPMID-4041 Change-Id: Ifab7d38b263f12173fcc96a5f0bd3375756c3c53 Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4673 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/Dimensions.h')
-rw-r--r--arm_compute/core/Dimensions.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/arm_compute/core/Dimensions.h b/arm_compute/core/Dimensions.h
index 960238c267..0e6e1f6681 100644
--- a/arm_compute/core/Dimensions.h
+++ b/arm_compute/core/Dimensions.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited.
+ * Copyright (c) 2017-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -68,14 +68,19 @@ public:
/** Accessor to set the value of one of the dimensions.
*
- * @param[in] dimension Dimension for which the value is set.
- * @param[in] value Value to be set for the dimension.
+ * @param[in] dimension Dimension for which the value is set.
+ * @param[in] value Value to be set for the dimension.
+ * @param[in] increase_dim_unit (Optional) Set to true if unit dimension increase the number of dimensions (e.g. for Coordinates), false otherwise (e.g. for TensorShapes)
*/
- void set(size_t dimension, T value)
+ void set(size_t dimension, T value, bool increase_dim_unit = true)
{
ARM_COMPUTE_ERROR_ON(dimension >= num_max_dimensions);
- _id[dimension] = value;
- _num_dimensions = std::max(_num_dimensions, dimension + 1);
+ _id[dimension] = value;
+ // Don't increase the number of dimensions if the new dimension is 1
+ if(increase_dim_unit || value != 1)
+ {
+ _num_dimensions = std::max(_num_dimensions, dimension + 1);
+ }
}
/** Alias to access the size of the first dimension */
T x() const