aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Farkas <raul.farkas@arm.com>2023-03-14 12:36:45 +0000
committerRaul Farkas <raul.farkas@arm.com>2023-05-05 15:06:55 +0100
commitfe85315f90d142b48df3f71bd1c34eef08fc66d8 (patch)
treeec2e80d657fa81e4d9e2d84b09aa77b061670989
parent7ede3176636c20465851daf9ff1f9210e4902264 (diff)
downloadethos-u-vela-fe85315f90d142b48df3f71bd1c34eef08fc66d8.tar.gz
MLBEDSW-7385: Unbound local var bug fix
Treat Dynamic Weights as FeatureMap to avoid issues during scheduling caused by having non constant OPs that produce tensors used as weights. Change-Id: I2b9ee7fb62a150c5052c6c3b1a6d34f22e9426a9 Signed-off-by: Raul Farkas <raul.farkas@arm.com>
-rw-r--r--ethosu/vela/mark_tensors.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ethosu/vela/mark_tensors.py b/ethosu/vela/mark_tensors.py
index 4b5bf1dc..13273e7a 100644
--- a/ethosu/vela/mark_tensors.py
+++ b/ethosu/vela/mark_tensors.py
@@ -75,6 +75,10 @@ def rewrite_mark_tensor_purpose(op, arch):
purpose = TensorPurpose.Weights
else:
purpose = TensorPurpose.FeatureMap
+ # Treat Dynamic Weights as FeatureMap to avoid issues during scheduling caused by
+ # having non constant OPs that produce tensors used as weights.
+ if any(op.type != Op.Const and tens == op.ofm and purpose == TensorPurpose.Weights for op in tens.ops):
+ purpose = TensorPurpose.FeatureMap
mark_purpose(tens, arch, purpose)
if op.type in memory_only_ops:
# Memory only operator input and output point to same data