diff options
author | Pablo Tello <pablo.tello@arm.com> | 2017-08-22 13:34:13 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | f5f34bb068565bf9435ba5561aae1c9280db8bbe (patch) | |
tree | 9920a815ee9653c3b97a09f90d765cb4efb7af06 /arm_compute/core/Utils.h | |
parent | 43fc5cd712eed23b9cec340f526e6d5fb5050afa (diff) | |
download | ComputeLibrary-f5f34bb068565bf9435ba5561aae1c9280db8bbe.tar.gz |
COMPMID-470: Neon Deconvolution.
Implemented by up-sampling the input with zeros insertions between the input samples and convolving the Deconvolution kernels on the up-sampled result.
The upsampling is performed by the function NEDeconvolutionLayerUpsample.
Convolving is done by NEDirectConvolutionLayer.
Change-Id: I25f7ba7c6b99cd9310797972ede40aeff4a54900
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/85319
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/Utils.h')
-rw-r--r-- | arm_compute/core/Utils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 06d674644b..7f53bec2c5 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -562,6 +562,38 @@ inline DataType data_type_for_convolution_matrix(const int16_t *conv, size_t siz } } +/** Returns expected shape for the deconvolution output tensor. + * + * @param[in] out_dims widht and height of the output tensor, these values can be obtained with the function deconvolution_output_dimensions. + * @param[in] input Shape of the input tensor. + * @param[in] weights Shape of the weights tensor. + * + * @return Deconvolution output tensor shape. + */ +TensorShape deconvolution_output_shape(const std::pair<unsigned int, unsigned int> &out_dims, TensorShape input, TensorShape weights); + +/** Returns expected width and height of the deconvolution's output tensor. + * + * @param[in] in_width Width of input tensor (Number of columns) + * @param[in] in_height Height of input tensor (Number of rows) + * @param[in] kernel_width Kernel width. + * @param[in] kernel_height Kernel height. + * @param[in] padx X axis padding. + * @param[in] pady Y axis padding. + * @param[in] ax The number of zeros added to right edge of the input. + * @param[in] ay The number of zeros added to top edge of the input. + * @param[in] upscalex How much to scale the X axis. + * @param[in] upscaley How much to scale the Y axis. + * @param[in] round Rounding policy to be used when computing the output's dimensions. + * + * @return A pair with the new width in the first position and the new height in the second. + */ + +const std::pair<unsigned int, unsigned int> deconvolution_output_dimensions(unsigned int in_width, unsigned int in_height, + unsigned int kernel_width, unsigned int kernel_height, + unsigned int padx, unsigned int pady, unsigned int ax, unsigned int ay, + float upscalex, float upscaley, DimensionRoundingType round); + /** Returns expected width and height of output scaled tensor depending on dimensions rounding mode. * * @param[in] width Width of input tensor (Number of columns) |