diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-06-19 13:09:53 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:53:34 +0000 |
commit | 19ea419e7f14d02aeb208c2fbd5a4ac55f4cb101 (patch) | |
tree | fe04ed9d40ebb8b717f63490f672a28c5b27d01e /arm_compute/core | |
parent | bb71fe50930f5669a7a325e0fa95fee559856793 (diff) | |
download | ComputeLibrary-19ea419e7f14d02aeb208c2fbd5a4ac55f4cb101.tar.gz |
COMPMID-809: Add NHWC data format on CLGEMMConvolutionLayer.
Change-Id: I50e4f5e7d47e21c300f754bee2c216863075b5cf
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/136191
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/TensorShape.h | 14 | ||||
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/arm_compute/core/TensorShape.h b/arm_compute/core/TensorShape.h index 0c3d9414e1..0340e1a644 100644 --- a/arm_compute/core/TensorShape.h +++ b/arm_compute/core/TensorShape.h @@ -136,6 +136,20 @@ public: // Make sure all empty dimensions are filled with 1 std::fill(_id.begin() + _num_dimensions, _id.end(), 1); } + /** Shifts right the tensor shape increasing its dimensions + * + * @param[in] step Rotation step + */ + void shift_right(size_t step) + { + ARM_COMPUTE_ERROR_ON(step > TensorShape::num_max_dimensions - num_dimensions()); + + std::rotate(begin(), begin() + TensorShape::num_max_dimensions - step, end()); + _num_dimensions += step; + + // Correct number dimensions to ignore trailing dimensions of size 1 + apply_dimension_correction(); + } /** Return a copy with collapsed dimensions starting from a given point. * diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index f64cf9d6ae..115cbe688d 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -110,6 +110,7 @@ inline TensorShape compute_reductionB_shape(const ITensorInfo &a) inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair<unsigned int, unsigned int> convolved_dims) { TensorShape col2im_shape{ input.tensor_shape() }; + col2im_shape.shift_right(1); col2im_shape.set(0, convolved_dims.first); col2im_shape.set(1, convolved_dims.second); col2im_shape.set(2, input.tensor_shape()[0]); |