diff options
author | Fredrik Svedberg <fredrik.svedberg@arm.com> | 2020-08-18 13:19:18 +0200 |
---|---|---|
committer | tim.hall <tim.hall@arm.com> | 2020-08-21 15:22:05 +0000 |
commit | 1575b9413de2569de25bb2520b898a91f24ad3b0 (patch) | |
tree | 13ecfc66b104d135c8c58b0236ee1aca17c9f109 /ethosu/vela/supported_operators.py | |
parent | 1cdc4675bab71c8a8d15b1687790954dab42ddd1 (diff) | |
download | ethos-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.py | 21 |
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 |