From 7579c75d870c25ee075e46a110b6b89cf266db64 Mon Sep 17 00:00:00 2001 From: Dwight Lidman Date: Mon, 24 Aug 2020 16:05:47 +0200 Subject: 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 Change-Id: I83c047ddf071d662343087c69bdb2a014dd209c3 --- ethosu/vela/supported_operators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/supported_operators.py') diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py index ab7f2db7..ec81e76b 100644 --- a/ethosu/vela/supported_operators.py +++ b/ethosu/vela/supported_operators.py @@ -90,6 +90,7 @@ class SupportedOperators: 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 @@ class SupportedOperators: 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, -- cgit v1.2.1