From 1a92f78e14f31f1423824228deb0628b7a9a9071 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Tue, 9 Feb 2021 16:08:26 +0100 Subject: MLBEDSW-4022: support PAD followed by pool operator PAD followed by max/average pool is run on NPU if NPU padding can be used. Average pool is converted to depthwise. Change-Id: Icc3652e6d9ecff5ac3dc7d92080313d90c245404 Signed-off-by: Louis Verhaard --- ethosu/vela/high_level_command_to_npu_op.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/high_level_command_to_npu_op.py') diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py index b5e7b4b9..1059e6e7 100644 --- a/ethosu/vela/high_level_command_to_npu_op.py +++ b/ethosu/vela/high_level_command_to_npu_op.py @@ -133,7 +133,8 @@ def get_rounding_mode(op: Operation, fused_quantize: bool) -> NpuRoundingMode: and op.kernel.elements_wh() == 1 ): rounding_mode = NpuRoundingMode.NATURAL - rounding_mode = op.attrs.get("rounding_mode", rounding_mode) + if op.rounding_mode is not None: + rounding_mode = op.rounding_mode return rounding_mode -- cgit v1.2.1