diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2019-12-19 09:35:40 +0000 |
---|---|---|
committer | Michele Di Giorgio <michele.digiorgio@arm.com> | 2020-01-02 12:38:22 +0000 |
commit | aadf8466ffc9597f76d53ce7b87e722cff7e72e6 (patch) | |
tree | 0415a632f95ca11905b8e8fcd90db61c99e2d7a2 /tests/validation/reference/DepthwiseConvolutionLayer.cpp | |
parent | 5255672226de359aa5357815047ae95ec027c07d (diff) | |
download | ComputeLibrary-aadf8466ffc9597f76d53ce7b87e722cff7e72e6.tar.gz |
COMPMID-2819 Fix depthwise reference when using ceil
Change-Id: I4117320fd6ba11365db9a164e4e44509a9a7ba09
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2498
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/reference/DepthwiseConvolutionLayer.cpp')
-rw-r--r-- | tests/validation/reference/DepthwiseConvolutionLayer.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/validation/reference/DepthwiseConvolutionLayer.cpp b/tests/validation/reference/DepthwiseConvolutionLayer.cpp index 0c7e92b8d0..4245140373 100644 --- a/tests/validation/reference/DepthwiseConvolutionLayer.cpp +++ b/tests/validation/reference/DepthwiseConvolutionLayer.cpp @@ -67,10 +67,8 @@ SimpleTensor<T> depthwise_convolution_fp(const SimpleTensor<T> &src, const Simpl const int input_depth = src.shape().z(); const int num_batches = src.shape().total_size() / (input_width * input_height * input_depth); - const int pad_left = conv_info.pad_left(); - const int pad_top = conv_info.pad_top(); - const int pad_right = conv_info.pad_right(); - const int pad_bottom = conv_info.pad_bottom(); + const int pad_left = conv_info.pad_left(); + const int pad_top = conv_info.pad_top(); const float patch_width = (filter_width + (dilation.x() - 1) * (filter_width - 1)); const float patch_height = (filter_height + (dilation.y() - 1) * (filter_height - 1)); @@ -83,8 +81,8 @@ SimpleTensor<T> depthwise_convolution_fp(const SimpleTensor<T> &src, const Simpl const int minimum_x = -pad_left + patch_half_width_floor; const int minimum_y = -pad_top + patch_half_height_floor; - const int maximum_x = input_width + pad_left + pad_right - static_cast<int>(patch_width); - const int maximum_y = input_height + pad_top + pad_bottom - static_cast<int>(patch_height); + const int maximum_x = (conv_info.stride().first * (dst_shape[0] - 1)); + const int maximum_y = (conv_info.stride().second * (dst_shape[1] - 1)); const T border_value(0); @@ -162,10 +160,8 @@ SimpleTensor<T> depthwise_convolution_quantized(const SimpleTensor<T> &src, cons const int input_depth = src.shape().z(); const int num_batches = src.shape().total_size() / (input_width * input_height * input_depth); - const int pad_left = conv_info.pad_left(); - const int pad_top = conv_info.pad_top(); - const int pad_right = conv_info.pad_right(); - const int pad_bottom = conv_info.pad_bottom(); + const int pad_left = conv_info.pad_left(); + const int pad_top = conv_info.pad_top(); const float patch_width = (filter_width + (dilation.x() - 1) * (filter_width - 1)); const float patch_height = (filter_height + (dilation.y() - 1) * (filter_height - 1)); @@ -178,8 +174,8 @@ SimpleTensor<T> depthwise_convolution_quantized(const SimpleTensor<T> &src, cons const int minimum_x = -pad_left + patch_half_width_floor; const int minimum_y = -pad_top + patch_half_height_floor; - const int maximum_x = input_width + pad_left + pad_right - static_cast<int>(patch_width); - const int maximum_y = input_height + pad_top + pad_bottom - static_cast<int>(patch_height); + const int maximum_x = (conv_info.stride().first * (dst_shape[0] - 1)); + const int maximum_y = (conv_info.stride().second * (dst_shape[1] - 1)); const bool is_quantized_per_channel = is_data_type_quantized_per_channel(weights.data_type()); |