From 4bf0cdf58416edc030ae7507ace95224785e4aa8 Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Mon, 6 Nov 2023 11:52:56 +0100 Subject: MLBEDSW-8261: Fix regression on AvgPool - When adding extended stride support for CONV_2D a regression was introduced for AvgPool causing an output diff for a particular test case. - The reason was that the logic for forcing the zero point to zero when generating the cmd stream did not have a check for explicit padding. - Updated logic to also include check for explicit padding. Change-Id: Iee4893a83a05279e592fe230f4d66d9c9ddb3e05 Signed-off-by: Johan Alfven --- ethosu/vela/high_level_command_to_npu_op.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py index 4384f2c..5e9dffa 100644 --- a/ethosu/vela/high_level_command_to_npu_op.py +++ b/ethosu/vela/high_level_command_to_npu_op.py @@ -311,7 +311,7 @@ def use_zero_point_0(ps, tens: Tensor, is_ifm_tensor: bool) -> bool: if ( ps.primary_op.original_type == Op.AvgPool and ps.primary_op.type == Op.Conv2DBias - and ps.primary_op.attrs.get("padding", None) == Padding.VALID + and ps.primary_op.attrs.get("padding", None) in (Padding.EXPLICIT, Padding.VALID) ): # Force zero point to 0 for AveragePool operators converted to a Conv2DBias with rounding away from # zero. -- cgit v1.2.1