From 993ea53f9aabb5746aa96512286bae2dc06ded1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Alfv=C3=A9n?= Date: Wed, 26 Oct 2022 10:20:01 +0200 Subject: MLBEDSW-7063: Fix output diff for networks with split ops - Due to a SPLIT op the following ADD op did get an IFM shape that is bigger than its original shape but that is handled by read_offset and read_shapes. The problem was that the IFM was considered not be primary and an erroneously swap was done. - Make it even more clear when the swap is allowed. Signed-off-by: Johan Alfven Change-Id: I0aefa04234f66c935f269267ae8ed1d77da64c81 --- ethosu/vela/scheduler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu/vela') diff --git a/ethosu/vela/scheduler.py b/ethosu/vela/scheduler.py index fbe2e169..b65cae8f 100644 --- a/ethosu/vela/scheduler.py +++ b/ethosu/vela/scheduler.py @@ -233,10 +233,10 @@ class SchedulerOperation: ifm2 = self.parent_op.ifm2 ofm = self.parent_op.ofm - ifm_can_be_primary = not (ifm.is_const or ifm.is_scalar or ifm.is_broadcast(ofm)) + ifm_can_swap = ifm.is_const or ifm.is_scalar ifm2_can_be_primary = not (ifm2.is_const or ifm2.is_scalar or ifm2.is_broadcast(ofm)) - if not ifm_can_be_primary and ifm2_can_be_primary: + if ifm_can_swap and ifm2_can_be_primary: # IFM2 is the primary input self.reversed_operands = True self.ifm, self.ifm2 = self.ifm2, self.ifm -- cgit v1.2.1