diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2017-11-23 09:49:51 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | 780db4eb6a9e3dee565d14f36d772038cd3253da (patch) | |
tree | 53490d6a03bdeb26d77bc8840d1dbf6027e81f5c /arm_compute/core/utils/misc/ShapeCalculator.h | |
parent | d7ba5397b676c966cb5069c7187a12a0c35305f5 (diff) | |
download | ComputeLibrary-780db4eb6a9e3dee565d14f36d772038cd3253da.tar.gz |
COMPMID-471 Implement Deconvolution on OpenCL
Change-Id: Ie00c6b08a51d30c5ce2637d40ee3d165b8a68686
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110311
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc/ShapeCalculator.h')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 15 |
1 files changed, 13 insertions, 2 deletions
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 |