diff options
Diffstat (limited to 'ethosu/vela/insert_dma.py')
-rw-r--r-- | ethosu/vela/insert_dma.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ethosu/vela/insert_dma.py b/ethosu/vela/insert_dma.py index eef42bf6..7049a05f 100644 --- a/ethosu/vela/insert_dma.py +++ b/ethosu/vela/insert_dma.py @@ -21,18 +21,19 @@ from .operation import Operation from .tensor import MemArea from .tensor import TensorPurpose + binary_elementwise_op = set(("AddAct", "MulAct", "SubAct", "Maximum", "Minimum")) + def insert_dma_cmd(op, arch): if op.type == "DMA": return op # Already rewritten for idx, tens in enumerate(op.inputs): if tens.mem_area in (MemArea.Dram, MemArea.OffChipFlash) and tens.mem_area != arch.fast_storage_mem_area: - if (tens.purpose == TensorPurpose.Weights or - (tens.purpose == TensorPurpose.FeatureMap and - op.type in binary_elementwise_op and - tens.shape != [])): + if tens.purpose == TensorPurpose.Weights or ( + tens.purpose == TensorPurpose.FeatureMap and op.type in binary_elementwise_op and tens.shape != [] + ): only_vector_product_consumers = True for oper in tens.consumers(): if oper is None or oper.attrs.get("npu_block_type") != NpuBlockType.VectorProduct: |