aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/utils
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-08-01 15:06:06 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit597a85666a84c9a9414264966651551564b79299 (patch)
tree6f2fd1bd8648c495b7e3324433ed902266fb2053 /arm_compute/core/utils
parent883f489da93e88d74aa0dfb206c56697ba0e63f0 (diff)
downloadComputeLibrary-597a85666a84c9a9414264966651551564b79299.tar.gz
COMPMID-872 - Rework NEGEMMConvolutionLayer to use NEGEMM
Change-Id: I55f0018ac7214775ebbca63f58a3bf5c93732fec Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/142632 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/utils')
-rw-r--r--arm_compute/core/utils/misc/ShapeCalculator.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h
index bf55add1d2..ac83dcb2cd 100644
--- a/arm_compute/core/utils/misc/ShapeCalculator.h
+++ b/arm_compute/core/utils/misc/ShapeCalculator.h
@@ -182,7 +182,7 @@ inline TensorShape compute_deconvolution_shape(const ITensorInfo &input, unsigne
return scale_out_shape;
}
-inline TensorShape compute_im2col_conv_shape(const ITensorInfo *input, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, const Size2D &dilation)
+inline TensorShape compute_im2col_conv_shape(const ITensorInfo *input, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, const Size2D &dilation, bool batch_size_on_z)
{
// The output shape will be the 2D shape used as input for GEMM [ out_channels * kernel_area, num_elems_per_out_channel ]
@@ -196,7 +196,14 @@ inline TensorShape compute_im2col_conv_shape(const ITensorInfo *input, const Siz
std::pair<unsigned int, unsigned int> out_dims = scaled_dimensions(output_shape[width_idx], output_shape[height_idx], kernel_dims.width, kernel_dims.height, conv_info, dilation);
output_shape.set(0, (output_shape[channel_idx] * kernel_dims.area() + (has_bias ? 1 : 0)));
output_shape.set(1, (out_dims.first * out_dims.second));
- output_shape.set(2, 1);
+ if(batch_size_on_z && output_shape.num_dimensions() >= 3)
+ {
+ output_shape.remove_dimension(2);
+ }
+ else
+ {
+ output_shape.set(2, 1);
+ }
return output_shape;
}