From d460c29db6fb51cafba7b5591cacc2ce4a7f4592 Mon Sep 17 00:00:00 2001 From: giuros01 Date: Wed, 14 Aug 2019 16:49:27 +0100 Subject: COMPMID-2568: NEON Convolution layer failure Fixing the output tile size used when one of height or width is less than 4. Also added a test case that stresses this out. Change-Id: I99bb689f26aef713f8206c7d702f9fcf1017af58 Signed-off-by: giuros01 Reviewed-on: https://review.mlplatform.org/c/1744 Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins --- src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp | 2 +- tests/datasets/SmallConvolutionLayerDataset.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp b/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp index 01cdff674e..e699ad1815 100644 --- a/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEWinogradConvolutionLayer.cpp @@ -182,7 +182,7 @@ Size2D winograd_output_tile(const Size2D &input_dims, const Size2D &kernel_dims) Size2D output_tile = Size2D{}; if(kernel_dims == Size2D(3U, 3U)) { - output_tile = (input_dims.width <= 4 && input_dims.height <= 4) ? Size2D(2U, 2U) : Size2D(4U, 4U); + output_tile = (input_dims.width <= 4 || input_dims.height <= 4) ? Size2D(2U, 2U) : Size2D(4U, 4U); } else if(kernel_dims == Size2D(5U, 5U)) { diff --git a/tests/datasets/SmallConvolutionLayerDataset.h b/tests/datasets/SmallConvolutionLayerDataset.h index 22d0bc582a..e85978c49a 100644 --- a/tests/datasets/SmallConvolutionLayerDataset.h +++ b/tests/datasets/SmallConvolutionLayerDataset.h @@ -49,6 +49,7 @@ public: // Batch size 4 add_config(TensorShape(23U, 27U, 5U, 4U), TensorShape(3U, 3U, 5U, 21U), TensorShape(21U), TensorShape(21U, 25U, 21U, 4U), PadStrideInfo(1, 1, 0, 0)); add_config(TensorShape(8U, 8U, 2U), TensorShape(3U, 3U, 2U, 1U), TensorShape(1U), TensorShape(8U, 8U, 1U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(3U, 9U), TensorShape(3U, 3U), TensorShape(1), TensorShape(3U, 9U), PadStrideInfo(1, 1, 1, 1)); } }; -- cgit v1.2.1