diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-08-13 11:20:41 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 916d1bcee42051721a82cfb46b52855c2fe56646 (patch) | |
tree | e3e38a8deddc558cabeda6fb7d14b2d45c8db2c4 /arm_compute/core/utils | |
parent | 61de78aba1b405663c6620be15418873a2ee914a (diff) | |
download | ComputeLibrary-916d1bcee42051721a82cfb46b52855c2fe56646.tar.gz |
COMPMID-1498 - Enable grouping in CLGEMMConvolutionLayer
Change-Id: I15c7df21773145b03f42b6f78bd7ad2e5b8a5219
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/144126
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 8a00c22306..c40e7119b2 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -55,19 +55,20 @@ inline TensorShape compute_permutation_output_shape(const ITensorInfo &input, co permute(output_shape, perm); return output_shape; } -inline TensorShape compute_weights_reshaped_shape(const ITensorInfo &weights, bool has_bias = false, const unsigned int num_groups = 1) +inline TensorShape compute_weights_reshaped_shape(const ITensorInfo &weights, bool has_bias = false, unsigned int num_groups = 1) { // Number of groups greater than one are only supported for NCHW data layout, and the number of weights must be a multiple of it. - ARM_COMPUTE_ERROR_ON(num_groups == 0); - ARM_COMPUTE_ERROR_ON((weights.dimension(3) % num_groups) != 0); ARM_COMPUTE_ERROR_ON(weights.data_layout() == DataLayout::NHWC && num_groups > 1); + ARM_COMPUTE_ERROR_ON((weights.dimension(3) % num_groups) != 0); // Calculate output shape TensorShape weights_reshaped{ weights.tensor_shape() }; + weights_reshaped.set(3, weights_reshaped[3] / num_groups); + weights_reshaped.collapse(3); const size_t tmp_dim = weights_reshaped[0]; - weights_reshaped.set(0, weights_reshaped[1] / num_groups); + weights_reshaped.set(0, weights_reshaped[1]); weights_reshaped.set(1, tmp_dim + (has_bias ? 1 : 0)); if(weights.num_dimensions() < 5) { |