aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/supported_operators.py
diff options
context:
space:
mode:
authorDwight Lidman <dwight.lidman@arm.com>2020-11-05 10:34:41 +0100
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-11-10 13:40:57 +0000
commit73320a48dfa711f5938b0e3d8e03b9858558b899 (patch)
tree9f1b43f86304ce59681a35304401034e4dfa152d /ethosu/vela/supported_operators.py
parent6ae0e4212abf1b92506fcbb180f647a953a37d89 (diff)
downloadethos-u-vela-73320a48dfa711f5938b0e3d8e03b9858558b899.tar.gz
MLBEDSW-3377: fixup_stridedslice_output may silently change CPU ops
This commit removes the constraint on all tensor shapes matching the OFM shape. The motivation is that this constraint essentially only checks that the fixup function has run. This means that it removes the possibility for the fixup function to run after the supported operator check and this effectively means that any StridedSlice operator that would be placed on the CPU is still modified by the fixup function. Because the fixup function is moved to after the supported operators check, some unreachable cases are removed from the fixup function. Signed-off-by: Dwight Lidman <dwight.lidman@arm.com> Change-Id: I7a82126b7de73bd67873b4e6daf53a6767e33d16
Diffstat (limited to 'ethosu/vela/supported_operators.py')
-rw-r--r--ethosu/vela/supported_operators.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index 04cda1da..3e649e09 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -219,7 +219,6 @@ class SupportedOperators:
# StridedSlice specific checks:
self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_stridedslice_input_count)
self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_stridedslice_inputs_const)
- self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_stridedslice_tens_size_matches)
self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_stridedslice_stride_values)
self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_ellipsis_mask)
self.specific_constraints[Op.StridedSlice].append(SupportedOperators.constraint_axis_masks)
@@ -728,22 +727,6 @@ class SupportedOperators:
return valid, f"Op has non-constant tensors: {extra}"
@staticmethod
- def constraint_stridedslice_tens_size_matches(op):
- "All Input sizes must match OFM size"
- ifm, begin, end, strides = op.inputs
- ifm_size = len(ifm.shape)
- ofm_size = len(op.ofm.shape)
- begin_size = len(begin.values)
- end_size = len(end.values)
- strides_size = len(strides.values)
- valid = ifm_size == ofm_size == begin_size == end_size == strides_size
- extra = (
- f"Op has ofm_size={ofm_size}, ifm_size={ifm_size},"
- f" begin_size={begin_size}, end_size={end_size} and strides_size={strides_size}"
- )
- return valid, extra
-
- @staticmethod
def constraint_stridedslice_stride_values(op):
"All Strides values must be 1"
strides = op.inputs[3]