diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-06-28 16:29:29 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 215b4ea6c9dee480a22070d5873b0b8cb52531a0 (patch) | |
tree | 398e552c4d01c0b84d03a873098a9183ba8f82e4 /arm_compute/core/utils/misc/ShapeCalculator.h | |
parent | ad486e21e5870f41774f30825c270762e08ae71e (diff) | |
download | ComputeLibrary-215b4ea6c9dee480a22070d5873b0b8cb52531a0.tar.gz |
COMPMID-1277 - Optimizing CLIm2ColKernel for NHWC.
This patch includes:
- Im2Col optimizations for NHWC using a new data layout
- Refactoring of CLIm2ColKernel adding validation method and auto-init
- Removed im2col_reduced from CLIm2ColKernel and created a new kernel CLFlattenLayerKernel
Change-Id: I1620640b6796baa268324b33ae92cdd8de53e27c
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/141241
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc/ShapeCalculator.h')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 1e5b9afd0e..0a2a535502 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -215,19 +215,13 @@ inline TensorShape compute_im2col_conv_shape(const ITensorInfo *input, const Siz return output_shape; } -inline TensorShape compute_im2col_fc_shape(const ITensorInfo *input, const int num_input_dimensions = 3) +inline TensorShape compute_flatten_shape(const ITensorInfo *input) { - TensorShape output_shape{ input->tensor_shape() }; - - output_shape.collapse(num_input_dimensions); + // The output shape will be the flatten version of the input (i.e. [ width * height * channels, num_batches, ... ] ). Used for FlattenLayer and FullyConnectedLayer. - return output_shape; -} -inline TensorShape compute_im2col_flatten_shape(const ITensorInfo *input) -{ - // The output shape will be the flatten version of the input (i.e. [ width * height * channels, 1, 1, ... ] ). Used for FlattenLayer. TensorShape output_shape{ input->tensor_shape() }; - output_shape.collapse(3, 0); + + output_shape.collapse(3); return output_shape; } |