diff options
-rw-r--r-- | ethosu/vela/insert_dma.py | 5 | ||||
-rw-r--r-- | ethosu/vela/tflite_writer.py | 1 |
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 |