MLBEDSW-8674: int16 VectorProduct should use Natural rounding
- Fixed output diff for FullyConnect int16
- Problem was that wrong rounding mode was used
- Reference uses Natural rounding for FullyConnect int16
Change-Id: I209313b6f89fed01678a448a935d5f6904b41057
Signed-off-by: Johan Alfven <johan.alfven@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 06d91a6..52d0718 100644
--- a/ethosu/vela/high_level_command_to_npu_op.py
+++ b/ethosu/vela/high_level_command_to_npu_op.py
@@ -144,7 +144,8 @@
if op.type.is_resize_op():
rounding_mode = NpuRoundingMode.NATURAL
elif (
- op.original_type.npu_block_type in (NpuBlockType.ConvolutionMxN, NpuBlockType.ConvolutionDepthWise)
+ op.original_type.npu_block_type
+ in (NpuBlockType.ConvolutionMxN, NpuBlockType.ConvolutionDepthWise, NpuBlockType.VectorProduct)
and op.ifm.dtype == DataType.int16
):
rounding_mode = NpuRoundingMode.NATURAL