From f47bfb97fa8bc928a7860b84b7b227f716f65e58 Mon Sep 17 00:00:00 2001 From: Sanghoon Lee Date: Tue, 23 Jan 2018 15:16:47 +0000 Subject: COMPMID-594: Implement reference and CL/NEON validation for LocallyConnected Change-Id: I01e7abcf3f1b19458128e277044af850ad9fa224 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118610 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- src/runtime/CL/functions/CLLocallyConnectedLayer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/runtime/CL/functions/CLLocallyConnectedLayer.cpp') diff --git a/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp b/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp index 9120aadf17..d284949323 100644 --- a/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp +++ b/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp @@ -67,10 +67,13 @@ void CLLocallyConnectedLayer::configure(const ICLTensor *input, const ICLTensor std::tie(stride_x, stride_y) = conv_info.stride(); std::tie(pad_x, pad_y) = conv_info.pad(); + const unsigned int kernel_width = weights->info()->dimension(0); + const unsigned int kernel_height = weights->info()->dimension(1); + // Get convolved dimensions unsigned int conv_w = 0; unsigned int conv_h = 0; - std::tie(conv_w, conv_h) = scaled_dimensions(input->info()->dimension(0), input->info()->dimension(1), weights->info()->dimension(0), weights->info()->dimension(1), + std::tie(conv_w, conv_h) = scaled_dimensions(input->info()->dimension(0), input->info()->dimension(1), kernel_width, kernel_height, conv_info); ARM_COMPUTE_ERROR_ON_MSG((output->info()->dimension(0) != conv_w) || (output->info()->dimension(1) != conv_h), "Output shape does not match the expected one"); @@ -106,7 +109,7 @@ void CLLocallyConnectedLayer::configure(const ICLTensor *input, const ICLTensor _memory_group.manage(&_gemm_output); // Configure kernels - _input_im2col_kernel.configure(input, &_input_im2col_reshaped, Size2D(conv_w, conv_h), conv_info, _has_bias); + _input_im2col_kernel.configure(input, &_input_im2col_reshaped, Size2D(kernel_width, kernel_height), conv_info, _has_bias); _weights_reshape_kernel.configure(weights, biases, &_weights_reshaped); _mm_kernel.configure(&_input_im2col_reshaped, &_weights_reshaped, &_gemm_output); _output_col2im_kernel.configure(&_gemm_output, output, std::make_pair(conv_w, conv_h)); -- cgit v1.2.1