aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/supported_operators.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/supported_operators.py')
-rw-r--r--ethosu/vela/supported_operators.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index 3e649e09..b537b650 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -379,9 +379,13 @@ class SupportedOperators:
@docstring_format_args([supported_fused_activations])
def constraint_faf(cls, op):
"The fused activation function (if present) must be one of type: {}"
- faf = op.activation
- valid = (faf is None) or (faf in cls.supported_fused_activations)
- return valid, f"Op has its fused activation function as: {faf}"
+ if op.activation is None:
+ res = True, "Op has no fused activation function"
+ else:
+ faf = op.activation.op_type
+ valid = faf in cls.supported_fused_activations
+ res = valid, f"Op has its fused activation function as: {faf}"
+ return res
@staticmethod
def constraint_stride_type(op):