From b660dcf2a7b21d02818e0a5f2c38ecd19d39b5c8 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 13 Dec 2017 10:48:06 +0000 Subject: COMPMID-556: Fix NEConvolutionLayer for fully connected convolution. Fixes weights shapes and assembly kernels dispatch parameters in case of fully connected convolution. Change-Id: I872c5934aab1d8ea6ef154d843521b5618fa2dcc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/113062 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com Reviewed-by: Anthony Barbier --- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/runtime/NEON/functions/NEConvolutionLayer.cpp') diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 2717bbfabc..25c639f7ea 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -187,9 +187,17 @@ void NEConvolutionLayer::configure(const ITensor *input, const ITensor *weights, { if(_are_weights_reshaped) { - const unsigned int transpose_width = 16 / input->info()->element_size(); - mat_weights_cols = weights_info.num_kernels(); - mat_weights_rows = weights->info()->dimension(0) / transpose_width + (_has_bias ? 1 : 0); + if(_is_fully_connected_convolution) + { + mat_weights_cols = weights_info.num_kernels(); + mat_weights_rows = weights->info()->dimension(1); + } + else + { + const unsigned int transpose_width = 16 / input->info()->element_size(); + mat_weights_cols = weights_info.num_kernels(); + mat_weights_rows = weights->info()->dimension(0) / transpose_width + (_has_bias ? 1 : 0); + } } else { @@ -267,7 +275,7 @@ void NEConvolutionLayer::configure(const ITensor *input, const ITensor *weights, // Configure matrix multiplication kernel if(_is_fully_connected_convolution) { - _mm_optimised_kernel->configure(&_input_im2col_reshaped, weights, &_gemm_output, &_workspace, 1.f, 0.f, true, false); + _mm_optimised_kernel->configure(&_input_im2col_reshaped, weights, &_gemm_output, &_workspace, 1.f, 0.f); } else { -- cgit v1.2.1