From 19ea419e7f14d02aeb208c2fbd5a4ac55f4cb101 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 19 Jun 2018 13:09:53 +0100 Subject: COMPMID-809: Add NHWC data format on CLGEMMConvolutionLayer. Change-Id: I50e4f5e7d47e21c300f754bee2c216863075b5cf Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/136191 Tested-by: Jenkins Reviewed-by: Giorgio Arena Reviewed-by: Gian Marco Iodice --- src/runtime/CL/functions/CLLocallyConnectedLayer.cpp | 10 ++++++++-- 1 file changed, 8 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 d15e5dfa3d..40bf032d69 100644 --- a/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp +++ b/src/runtime/CL/functions/CLLocallyConnectedLayer.cpp @@ -48,7 +48,10 @@ void calculate_shapes(const ITensorInfo *input, const ITensorInfo *weights, cons // Get convolved dimensions unsigned int conv_w = 0; unsigned int conv_h = 0; - std::tie(conv_w, conv_h) = scaled_dimensions(input->dimension(0), input->dimension(1), kernel_width, kernel_height, + std::tie(conv_w, conv_h) = scaled_dimensions(input->dimension(0), + input->dimension(1), + kernel_width, + kernel_height, conv_info); const size_t mat_weights_cols = weights->dimension(3); @@ -61,9 +64,12 @@ void calculate_shapes(const ITensorInfo *input, const ITensorInfo *weights, cons const size_t mat_input_rows = conv_w * conv_h; shape_im2col = input->tensor_shape(); + if(shape_im2col.num_dimensions() >= 3) + { + shape_im2col.remove_dimension(2); + } shape_im2col.set(0, mat_input_cols); shape_im2col.set(1, mat_input_rows); - shape_im2col.set(2, 1); shape_gemm = shape_im2col; shape_gemm.set(0, mat_weights_cols); -- cgit v1.2.1