diff options
author | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-12-21 14:49:13 +0100 |
---|---|---|
committer | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-12-21 18:22:20 +0100 |
commit | 6bb8f6700e0bc1a254fab745b8d3fac767270304 (patch) | |
tree | 3def6e3976b597a609a7a8ee3f425ba2e547aa94 /ethosu/vela | |
parent | eeb85154b00a9864d0d63e382e9c80ca8e294d5d (diff) | |
download | ethos-u-vela-6bb8f6700e0bc1a254fab745b8d3fac767270304.tar.gz |
MLBEDSW-3786 Fix index out of range on ofm_shapes
Ofm_shapes only set on operator for npu_ops.
Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com>
Change-Id: Iab98e24132f3a4004debce9013355e2ef16b0b6f
Diffstat (limited to 'ethosu/vela')
-rw-r--r-- | ethosu/vela/pass_packing.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ethosu/vela/pass_packing.py b/ethosu/vela/pass_packing.py index 8f6660c2..0820034d 100644 --- a/ethosu/vela/pass_packing.py +++ b/ethosu/vela/pass_packing.py @@ -231,9 +231,11 @@ def pack_into_passes(nng, arch, verbose_packing=False): ofm_tensor = op.ofm if ofm_tensor is None: ofm_tensor = op.outputs[0] - build_pass((op,), ofm_tensor, op.ofm_shapes[0].clone()) + ofm_shape = op.ofm_shapes[0].clone() if op.run_on_npu else None - def build_pass(start_ops_to_process, ofm_tensor=None, ofm_shapes=None): + build_pass((op,), ofm_tensor, ofm_shape) + + def build_pass(start_ops_to_process, ofm_tensor=None, ofm_shape=None): reverse_ops_list = [] curr_flags = PassFlags.Empty npu_block_type = NpuBlockType.Default @@ -416,7 +418,7 @@ def pack_into_passes(nng, arch, verbose_packing=False): ps.ifm_shapes.append(ps.primary_op.ifm_shapes[0]) ps.ofm_tensor = ofm_tensor - ps.ofm_shapes.append(ofm_shapes) + ps.ofm_shapes.append(ofm_shape) assert ps.placement != PassPlacement.Npu or ps.ofm_tensor is not None ps.weight_tensor = ps.get_primary_op_ifm_weights()[1] |