aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/supported_operators.py
diff options
context:
space:
mode:
authorFredrik Svedberg <fredrik.svedberg@arm.com>2020-08-18 13:19:18 +0200
committertim.hall <tim.hall@arm.com>2020-08-21 15:22:05 +0000
commit1575b9413de2569de25bb2520b898a91f24ad3b0 (patch)
tree13ecfc66b104d135c8c58b0236ee1aca17c9f109 /ethosu/vela/supported_operators.py
parent1cdc4675bab71c8a8d15b1687790954dab42ddd1 (diff)
downloadethos-u-vela-1575b9413de2569de25bb2520b898a91f24ad3b0.tar.gz
[MLBEDSW-2730] Implement LUT generation for softmax uint8/int8
Implemented LUT generation for softmax uint8/int8 to match the reference. Change-Id: Ib9acaa295ee1066591e800023d75f364520b44c1 Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com>
Diffstat (limited to 'ethosu/vela/supported_operators.py')
-rw-r--r--ethosu/vela/supported_operators.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py
index c4186018..9e415b51 100644
--- a/ethosu/vela/supported_operators.py
+++ b/ethosu/vela/supported_operators.py
@@ -54,19 +54,11 @@ class SupportedOperators:
self.binary_elem_wise_min_max_ops = set(("Minimum", "Maximum",))
self.binary_elem_wise_shift_ops = set(("SHL", "SHR",))
self.binary_elem_wise_add_mul_sub = set(
- (
- "AddAct",
- "MulAct",
- "SubAct",
- "QuantizedAdd",
- "QuantizedSub",
- "QuantizedMul",
- "Mul",
- "Add",
- "Sub",
- )
+ ("AddAct", "MulAct", "SubAct", "QuantizedAdd", "QuantizedSub", "QuantizedMul", "Mul", "Add", "Sub",)
+ )
+ self.binary_elem_wise_main_ops = (
+ self.binary_elem_wise_min_max_ops | self.binary_elem_wise_add_mul_sub | self.binary_elem_wise_shift_ops
)
- self.binary_elem_wise_main_ops = self.binary_elem_wise_min_max_ops | self.binary_elem_wise_add_mul_sub | self.binary_elem_wise_shift_ops
self.elem_wise_main_ops = self.binary_elem_wise_main_ops | self.unary_elem_wise_main_ops
self.activation_ops = set(
(
@@ -166,7 +158,10 @@ class SupportedOperators:
return False
if (
t.element_size() > 2
- and op.type not in set(("Requantize", "ReduceSum", "CLZ",)) | self.binary_elem_wise_add_mul_sub | self.binary_elem_wise_shift_ops
+ and op.type
+ not in set(("Requantize", "ReduceSum", "CLZ",))
+ | self.binary_elem_wise_add_mul_sub
+ | self.binary_elem_wise_shift_ops
):
return False
# check size