aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bohlin <jacob.bohlin@arm.com>2020-07-13 11:39:36 +0200
committerTim Hall <tim.hall@arm.com>2020-07-14 15:31:21 +0100
commit68a04b129c8c341d4c1a621c04cfe5306390300c (patch)
treeb1b097a38a3ab8181b3b6660fe82763ae3b0775a
parent9b64ba0f5b45359db4c12fa77fc2caffb09f4432 (diff)
downloadethos-u-vela-68a04b129c8c341d4c1a621c04cfe5306390300c.tar.gz
MLBEDSW-2641: Fix crash for network with only CPU ops
Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com> Change-Id: Ia9c70d62c6abc827cbdf73a8bb37afd595796741
-rw-r--r--ethosu/vela/insert_dma.py5
-rw-r--r--ethosu/vela/tflite_writer.py1
2 files changed, 4 insertions, 2 deletions
diff --git a/ethosu/vela/insert_dma.py b/ethosu/vela/insert_dma.py
index 5c05fc8f..4ea4621d 100644
--- a/ethosu/vela/insert_dma.py
+++ b/ethosu/vela/insert_dma.py
@@ -27,8 +27,9 @@ binary_elementwise_op = set(("AddAct", "MulAct", "SubAct", "Maximum", "Minimum")
def insert_dma_cmd(op, arch):
- if op.type == "DMA":
- return op # Already rewritten
+ if op.type == "DMA" or not op.run_on_npu:
+ return op
+
for idx, tens in enumerate(op.inputs):
if tens.mem_type not in (MemType.Scratch, MemType.Scratch_fast):
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py
index cf40b5b5..3f3b7b1b 100644
--- a/ethosu/vela/tflite_writer.py
+++ b/ethosu/vela/tflite_writer.py
@@ -316,6 +316,7 @@ class TFLiteSerialiser:
scratch_tensors = [tens for tens in all_tensors if tens.name.endswith("scratch")]
+ scratch_fast_tensor = None
for tens in all_tensors:
if tens.name.endswith("scratch_fast"):
scratch_fast_tensor = tens