MLBEDSW-2867: Split operators get placed on CPU
This commit fixes a bug wherein Split operators
are being erroneously placed on the CPU due to
a 0-dimensional input that disqualifies it from
NPU placement; a restriction introduced in a
recent commit.
Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: I83c047ddf071d662343087c69bdb2a014dd209c3
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index ab7f2db..ec81e76 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -90,6 +90,7 @@
self.memory_only_ops = (
set(("Squeeze", "Reshape", "QuantizedReshape", "ExpandDims",)) | self.concat_ops | self.split_ops
)
+ self.shapeless_input_ops = self.binary_elem_wise_main_ops | set(("Split", "SplitV",))
self.supported_fused_activations = set(("Relu", "Relu6", "ReluN1To1", "Tanh", "Sigmoid", "LUT",))
self.supported_operators = (
self.npu_pre_ops | self.mac_main_ops | self.elem_wise_main_ops | self.npu_post_ops | self.memory_only_ops
@@ -138,7 +139,7 @@
if not t.has_fully_defined_shape():
print("Warning:", op.type, "has input(s) of undefined shape, placing on CPU")
return False
- if t.shape == [] and op.type not in self.binary_elem_wise_main_ops:
+ if t.shape == [] and op.type not in self.shapeless_input_ops:
print(
"Warning:",
op.type,