aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-08-07 16:59:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit088c2b038ea2de67e90f8a7179c129133127f854 (patch)
tree1b5bab238b23b86d2be6ef5bbe6e8f34250d9818
parentf2bd261353979db33503f5645202e7375eae8d99 (diff)
downloadComputeLibrary-088c2b038ea2de67e90f8a7179c129133127f854.tar.gz
COMPMID-1188 Fix WeightsReshape doc
Change-Id: If15e06ad3aa092d32c4d88172a9fea79a7416b2b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143128 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h6
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h b/arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h
index 6c93c23cec..d3bbbaf470 100644
--- a/arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h
+++ b/arm_compute/core/CL/kernels/CLWeightsReshapeKernel.h
@@ -75,7 +75,8 @@ public:
* @warning Appending biases to weights reshaped matrix is not supported for quantized asymmetric types.
* @param[out] output The output tensor. Should be a 2D Tensor if there are no groups and the weights are not shared; a 3D Tensor otherwise.
* Data types supported: Same as @p input
- * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution
+ * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution.
+ * Number of groups greater than one are only supported for NCHW data layout, and the number of weights must be a multiple of it.
*/
void configure(const ICLTensor *input, const ICLTensor *biases, ICLTensor *output, const unsigned int num_groups = 1);
/** Static function to check if given info will lead to a valid configuration of @ref CLWeightsReshapeKernel
@@ -87,7 +88,8 @@ public:
* @warning Appending biases to weights reshaped matrix is not supported for quantized asymmetric types.
* @param[in] output The output tensor. Should be a 2D Tensor if there are no groups and the weights are not shared; a 3D Tensor otherwise.
* Data types supported: Same as @p input
- * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution
+ * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution.
+ * Number of groups greater than one are only supported for NCHW data layout, and the number of weights must be a multiple of it.
*
* @return a status
*/
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index 0a2a535502..f726ce9ad3 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -57,6 +57,8 @@ inline TensorShape compute_permutation_output_shape(const ITensorInfo &input, co
}
inline TensorShape compute_weights_reshaped_shape(const ITensorInfo &weights, bool has_bias = false, const 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);