MLBEDSW-2475: leaky relu not handling negative alpha value
This commit places LeakyReLU operators with
a negative alpha value on the CPU and avoids
a crash during command stream generation.
Signed-off-by: Dwight Lidman <dwight.lidman@arm.com>
Change-Id: Iac68c5a9fdbf26facb709660965615b2b5b551f9
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index cbd5d6c..5676ba1 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -286,6 +286,11 @@
if op.type in self.binary_elem_wise_main_ops: # if op type is unary, ifm2_tensor is None
if len(ifm2_tensor.shape) > 2 and ifm2_tensor.shape[0] != 1:
return False
+
+ # negative alpha values are not supported
+ if op.type == "LeakyRelu" and op.attrs["alpha"] < 0:
+ return False
+
return True
def check_memory_only_restrictions(self, op):