From 041f36d4dc1b6473d9f7136659a384d611fab0b6 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 18 Sep 2018 18:38:37 +0100 Subject: COMPMID-1446 : Add support for 3D output in NEGEMMLowpOutputStage Change-Id: I61e7d39d09a9936b1128ec04038fa2d8dfe6a2c8 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/149211 Reviewed-by: Isabella Gottardi Reviewed-by: Anthony Barbier Tested-by: bsgcomp --- arm_compute/core/utils/misc/ShapeCalculator.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arm_compute/core/utils/misc') diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index 1fdf5b8ff5..b4ab10c56c 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -513,6 +513,21 @@ inline TensorShape compute_mm_shape(const ITensorInfo &input0, const ITensorInfo return output_shape; } +inline TensorShape compute_output_stage_shape(const ITensorInfo &input, unsigned int gemm_3d_depth = 1) +{ + ARM_COMPUTE_ERROR_ON(input.data_layout() != DataLayout::NHWC && gemm_3d_depth > 1); + + TensorShape output_shape = input.tensor_shape(); + if(gemm_3d_depth > 1) + { + output_shape.set(0, input.tensor_shape().x()); + output_shape.set(1, input.tensor_shape().y() / gemm_3d_depth); + output_shape.set(2, gemm_3d_depth); + } + + return output_shape; +} + inline TensorShape compute_strided_slice_shape(const ITensorInfo &input, const Coordinates &starts, const Coordinates &ends, const Coordinates &strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask) -- cgit v1.2.1