From b7e3028a2bf81ca247895b8550f5a5da02d2483e Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Fri, 2 Feb 2018 11:38:55 +0000 Subject: COMPMID-890: Valgrind: NEON Convolution Layer validation fails Change-Id: I5296815cf04e5f805d6523196567b6c01715c8b5 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118711 Reviewed-by: Anthony Barbier Reviewed-by: Georgios Pinitas Tested-by: Jenkins --- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 6 +++--- tests/benchmark/fixtures/ConvolutionLayerFixture.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 598d350505..0f00f74fae 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -186,7 +186,7 @@ Status validate_and_initialize_values(const ITensorInfo *input, const ITensorInf ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_FIXED_POINT(input, weights); ARM_COMPUTE_RETURN_ERROR_ON(!weights_info.are_reshaped() && weights->dimension(2) != input->dimension(2)); ARM_COMPUTE_RETURN_ERROR_ON(weights->num_dimensions() > 4); - ARM_COMPUTE_ERROR_ON(weights_info.are_reshaped() && is_data_type_quantized_asymmetric(input->data_type())); + ARM_COMPUTE_RETURN_ERROR_ON(weights_info.are_reshaped() && is_data_type_quantized_asymmetric(input->data_type())); dt = input->data_type(); is_quantized = is_data_type_quantized_asymmetric(dt); @@ -195,11 +195,11 @@ Status validate_and_initialize_values(const ITensorInfo *input, const ITensorInf { if(is_quantized) { - ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::S32); + ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(biases, 1, DataType::S32); } else { - ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases); + ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(input, biases); } ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_FIXED_POINT(input, biases); ARM_COMPUTE_RETURN_ERROR_ON(!weights_info.are_reshaped() && biases->dimension(0) != weights->dimension(3)); diff --git a/tests/benchmark/fixtures/ConvolutionLayerFixture.h b/tests/benchmark/fixtures/ConvolutionLayerFixture.h index 0d2c3fd955..7dc7de0dc1 100644 --- a/tests/benchmark/fixtures/ConvolutionLayerFixture.h +++ b/tests/benchmark/fixtures/ConvolutionLayerFixture.h @@ -46,11 +46,12 @@ public: const unsigned int fixed_point_position = 4; src_shape.set(3 /* batch */, batches); dst_shape.set(3 /* batch */, batches); + DataType bias_data_type = is_data_type_quantized_asymmetric(data_type) ? DataType::S32 : data_type; // Create tensors src = create_tensor(src_shape, data_type, 1, fixed_point_position); weights = create_tensor(weights_shape, data_type, 1, fixed_point_position); - biases = create_tensor(biases_shape, data_type, 1, fixed_point_position); + biases = create_tensor(biases_shape, bias_data_type, 1, fixed_point_position); dst = create_tensor(dst_shape, data_type, 1, fixed_point_position); // Create and configure function -- cgit v1.2.1