From 6a8d3b6db13042a859972c33cf40cfeb6d7cfcda Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Fri, 31 Aug 2018 10:07:09 +0100 Subject: COMPMID-1218 Implementing Batch to Space on OpenCL Change-Id: I12ba4c0c35f086ea3f395970b85af5bf8f94850b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/145052 Reviewed-by: Pablo Tello Tested-by: Jenkins --- arm_compute/core/utils/misc/ShapeCalculator.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/utils') diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index e0b6ce639f..1a86d27727 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -433,7 +433,6 @@ inline TensorShape compute_mm_shape(const ITensorInfo &input0, const ITensorInfo 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) @@ -449,6 +448,16 @@ inline TensorShape compute_strided_slice_shape(const ITensorInfo &input, return compute_strided_slice_output_shape(input_shape, starts_abs, ends_abs, final_strides); } +inline TensorShape compute_batch_to_space_shape(const ITensorInfo *input, const int block_x, const int block_y) +{ + ARM_COMPUTE_ERROR_ON(block_x <= 0 || block_y <= 0); + TensorShape output_shape{ input->tensor_shape() }; + output_shape.set(0, input->tensor_shape()[0] * block_x); + output_shape.set(1, input->tensor_shape()[1] * block_y); + output_shape.set(3, input->tensor_shape()[3] / (block_x * block_y)); + + return output_shape; +} template inline TensorShape extract_shape(T *data) -- cgit v1.2.1