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 <louis.verhaard@arm.com>
diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py
index b5e7b4b..1059e6e 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 @@
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