From 780db4eb6a9e3dee565d14f36d772038cd3253da Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 23 Nov 2017 09:49:51 +0000 Subject: COMPMID-471 Implement Deconvolution on OpenCL Change-Id: Ie00c6b08a51d30c5ce2637d40ee3d165b8a68686 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110311 Reviewed-by: Pablo Tello Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- arm_compute/core/utils/misc/ShapeCalculator.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (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 f31eb3d336..c7667f2c7b 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017, 2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -106,7 +106,8 @@ inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input, unsigned int output_width = 0; unsigned int output_height = 0; - std::tie(output_width, output_height) = scaled_dimensions(input_shape.x(), input_shape.y(), weights_shape.x(), weights_shape.y(), conv_info); + std::tie(output_width, output_height) = scaled_dimensions(input_shape.x(), input_shape.y(), weights_shape.x(), + weights_shape.y(), conv_info); TensorShape output_shape{ input_shape }; output_shape.set(0, output_width); @@ -114,6 +115,16 @@ inline TensorShape compute_depthwise_convolution_shape(const ITensorInfo &input, return output_shape; } +inline TensorShape compute_deconvolution_shape(const ITensorInfo &input, unsigned int sx, unsigned int sy, unsigned int inner_border_right, unsigned int inner_border_top, const PadStrideInfo &info) +{ + TensorShape scale_out_shape(input.tensor_shape()); + const unsigned int out_x = input.dimension(0) + (input.dimension(0) - 1) * (sx - 1) + inner_border_right + 2 * info.pad().first; + const unsigned int out_y = input.dimension(1) + (input.dimension(1) - 1) * (sy - 1) + inner_border_top + 2 * info.pad().second; + scale_out_shape.set(0, out_x); + scale_out_shape.set(1, out_y); + + return scale_out_shape; +} } // namespace shape_calculator } // namespace misc } // namespace arm_compute -- cgit v1.2.1