From dda21afda93f3732491efdcf89af2b14396c683f Mon Sep 17 00:00:00 2001 From: Dwight Lidman Date: Wed, 11 Nov 2020 15:44:57 +0100 Subject: MLBEDSW-3463: StridedSlice fixup function causes infinite recursion This commit reverts a control flow path where already modified StridedSlice operators are left untouched. If not, Vela would recurse infinitely and crash. Signed-off-by: Dwight Lidman Change-Id: Iaf3ae916325bedd3dd1edd3395fb4a9ecf832590 --- ethosu/vela/graph_optimiser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ethosu/vela/graph_optimiser.py b/ethosu/vela/graph_optimiser.py index 73046302..899da074 100644 --- a/ethosu/vela/graph_optimiser.py +++ b/ethosu/vela/graph_optimiser.py @@ -456,6 +456,9 @@ def fixup_stridedslice_output(tens, arch, nng): assert len(tens.shape) == (len(op.inputs[0].shape) + n) op.attrs["new_axis_mask"] = 0 + else: + # Equal Rank StridedSlice, no need to insert reshape + return tens # Construct 1 shape tensor to be used by all inserted reshape ops new_shape_tens = create_const_tensor(op.name + "_reshape_shape", [1], DataType.int32, tens.shape) -- cgit v1.2.1