diff options
author | Dwight Lidman <dwight.lidman@arm.com> | 2021-09-29 17:00:09 +0200 |
---|---|---|
committer | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2021-10-01 14:04:46 +0000 |
commit | 352607ca99a4a71de11a241227982b9c95dc69b2 (patch) | |
tree | e84e6ecf74476daf40a7c2f8f5c671014c893717 /ethosu/vela/scheduler.py | |
parent | ef3ebddb6b4fd951046cbe7799721f6f0ed2fc87 (diff) | |
download | ethos-u-vela-352607ca99a4a71de11a241227982b9c95dc69b2.tar.gz |
MLBEDSW-5286 - MLCE: IndexError for ADD + TANH network
Resolves a bug where an IndexError would occur
if the same tensor was assigned to both IFM
and IFM2 of a binary elementwise operator
due to duplicates being allowed in operator
inputs but not in pass inputs.
Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: I39a6206a6252f6a848be9f9d4c5a8dc749c71699
Diffstat (limited to 'ethosu/vela/scheduler.py')
-rw-r--r-- | ethosu/vela/scheduler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ethosu/vela/scheduler.py b/ethosu/vela/scheduler.py index 044b246c..2ac47878 100644 --- a/ethosu/vela/scheduler.py +++ b/ethosu/vela/scheduler.py @@ -978,7 +978,10 @@ class Scheduler: new_tens.consumer_list.append(parent_op) parent_op.inputs[idx] = new_tens - sched_op.parent_ps.inputs[idx] = new_tens + # If the index is out of range, IFM and IFM2 are the same tensor + # and pass inputs don't have duplicates + if idx < len(sched_op.parent_ps.inputs): + sched_op.parent_ps.inputs[idx] = new_tens def print_schedule(self, schedule: Schedule): print(f"Schedule: '{schedule.name}'") |