aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-10-26 10:20:01 +0200
committerFredrik Svedberg <fredrik.svedberg@arm.com>2022-10-26 11:19:42 +0000
commit993ea53f9aabb5746aa96512286bae2dc06ded1b (patch)
treec2f785d471598a151e3e04396f4457b5cd555276
parent0b799e465b7b0ce8c5ea4f246a61773f607ebf74 (diff)
downloadethos-u-vela-993ea53f9aabb5746aa96512286bae2dc06ded1b.tar.gz
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 <johan.alfven@arm.com> Change-Id: I0aefa04234f66c935f269267ae8ed1d77da64c81
-rw-r--r--ethosu/vela/scheduler.py4
1 files changed, 2 insertions, 2 deletions
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