aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/high_level_command_to_npu_op.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/high_level_command_to_npu_op.py')
-rw-r--r--ethosu/vela/high_level_command_to_npu_op.py3
1 files changed, 2 insertions, 1 deletions
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 @@ 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