From f3c7d557371b26835e3183064de58354f3a8b3cb Mon Sep 17 00:00:00 2001 From: Fredrik Svedberg Date: Fri, 4 Nov 2022 09:48:49 +0100 Subject: MLBEDSW-6881 SHAPE single op network is optimised to nothing Fixed by adding an operation to copy the statically optimised data to the subgraph output. Change-Id: Ica757e37d5460237973444ffd39c7d2850f319e3 Signed-off-by: Fredrik Svedberg --- ethosu/vela/live_range.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ethosu/vela/live_range.py') diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py index fbb48ecd..2829f398 100644 --- a/ethosu/vela/live_range.py +++ b/ethosu/vela/live_range.py @@ -240,11 +240,11 @@ def extract_live_ranges_from_cascaded_passes( rng = lr_graph.get_or_create_range(tens, cpu_tensor_alignment) rng.mark_usage(time_for_pass) - op_subgraph = cps.passes[0].ops[0].attrs.get("subgraph", None) - op_type = cps.passes[0].ops[0].type + op = cps.passes[0].ops[0] if cps.passes[0].ops else None + op_subgraph = op.attrs.get("subgraph", None) if op else None if op_subgraph is not None and MemType.Permanent_CPU not in target_mem_type_set: - if op_type == Op.CustomNpuOp: + if op.type == Op.CustomNpuOp: # If the primary-op is an NpuOp that means this is where an Npu subgraph # is called. Go into said subgraph and extract live ranges before continuing. # Use default allocation alignment of 16 for Npu tensors -- cgit v1.2.1