aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight Lidman <dwight.lidman@arm.com>2020-06-11 15:32:42 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commit332a704c0dddfc31eef3c3a6119b1800da2e49fe (patch)
treedcb090a90a1336e9dd58b6a5a1e95ab40aab5256
parentec74fd828ba2453ec1b3ff385c99730a8a78bef6 (diff)
downloadethos-u-vela-332a704c0dddfc31eef3c3a6119b1800da2e49fe.tar.gz
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
-rw-r--r--ethosu/vela/supported_operators.py5
1 files changed, 5 insertions, 0 deletions
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):