diff options
author | Tim Hall <tim.hall@arm.com> | 2020-06-15 20:47:35 +0100 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | c30f495dc013a73e371dd8053a0381e4707ab309 (patch) | |
tree | 902ded0cf05e6d00eb0d1a1f9c1464a1052def92 /ethosu/vela/insert_dma.py | |
parent | 0fc46dc565b6991409169cc40fe9ac74237857fa (diff) | |
download | ethos-u-vela-c30f495dc013a73e371dd8053a0381e4707ab309.tar.gz |
Code clean-up using black and flake8
- No functional change
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: I5ab1198b9d092cd041fa9b85b2dee9900d299bfc
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: |