diff options
author | William Isaksson <william.isaksson@arm.com> | 2023-08-02 11:37:05 +0000 |
---|---|---|
committer | Rickard Bolin <rickard.bolin@arm.com> | 2023-08-07 08:24:15 +0000 |
commit | 631f600eeaeda4814bda720b3979f8aef33edbea (patch) | |
tree | 4cfc7f8b614b0eba22461f4230f2f165d502ba47 /ethosu/vela/extract_npu_subgraphs.py | |
parent | ea8c5374989ff9622d20b663e7707378636e4405 (diff) | |
download | ethos-u-vela-631f600eeaeda4814bda720b3979f8aef33edbea.tar.gz |
MLBEDSW-7865: Vela duplicates outputs
We now don't rewrite tensors if the tensor is already an output tensor of the current subgraph
Signed-off-by: William Isaksson <william.isaksson@arm.com>
Change-Id: I9cb36d830616a69d35180326437ff53bcaa62d71
Diffstat (limited to 'ethosu/vela/extract_npu_subgraphs.py')
-rw-r--r-- | ethosu/vela/extract_npu_subgraphs.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ethosu/vela/extract_npu_subgraphs.py b/ethosu/vela/extract_npu_subgraphs.py index dcc86878..c4f66b8f 100644 --- a/ethosu/vela/extract_npu_subgraphs.py +++ b/ethosu/vela/extract_npu_subgraphs.py @@ -246,12 +246,13 @@ def extract_subgraph(nng, orig_sg, arch): need_rewrite = True break for orig_out_tens in orig_sg.output_tensors: - if tens == orig_out_tens: - need_rewrite = True - elif tens.equivalence_id == orig_out_tens.equivalence_id: - need_rewrite = True - multiple_npu_sg_have_same_cpu_out_tens = True - output_tensor = orig_out_tens + if tens not in curr_sg.output_tensors: + if tens == orig_out_tens: + need_rewrite = True + elif tens.equivalence_id == orig_out_tens.equivalence_id: + need_rewrite = True + multiple_npu_sg_have_same_cpu_out_tens = True + output_tensor = orig_out_tens if need_rewrite: rewrite_tensor_npu_producer_cpu_consumers( |