From 332a704c0dddfc31eef3c3a6119b1800da2e49fe Mon Sep 17 00:00:00 2001 From: Dwight Lidman Date: Thu, 11 Jun 2020 15:32:42 +0200 Subject: 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 Change-Id: Iac68c5a9fdbf26facb709660965615b2b5b551f9 --- ethosu/vela/supported_operators.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ethosu') diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py index cbd5d6cc..5676ba1c 100644 --- a/ethosu/vela/supported_operators.py +++ b/ethosu/vela/supported_operators.py @@ -286,6 +286,11 @@ class SupportedOperators: 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): -- cgit v1.2.1