From 189f748e1a79ed88044efbe7137963bca830cbb5 Mon Sep 17 00:00:00 2001 From: Diqing Zhong Date: Tue, 26 Jan 2021 12:12:51 +0100 Subject: MLBEDSW-3224: Support HardSwish Change-Id: If49abc31f093f1bd3393bee86f821fd35972086f Signed-off-by: Diqing Zhong --- ethosu/vela/operation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/operation.py') diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py index 8d54d658..73953cec 100644 --- a/ethosu/vela/operation.py +++ b/ethosu/vela/operation.py @@ -165,7 +165,7 @@ class Op(Enum): GatherV2 = OperatorInfo() Greater = OperatorInfo() GreaterEqual = OperatorInfo() - HardSwish = OperatorInfo() + HardSwish = OperatorInfo(indices=IFM_INDICES) HashtableLookup = OperatorInfo() Identity = OperatorInfo() If = OperatorInfo() @@ -305,7 +305,7 @@ class Op(Enum): return self in (Op.Relu, Op.Relu6, Op.ReluN1To1, Op.Clip) def is_activation_op(self): - return self.is_relu_op() or self in (Op.Tanh, Op.Sigmoid, Op.Softmax, Op.LUT) + return self.is_relu_op() or self in (Op.Tanh, Op.Sigmoid, Op.Softmax, Op.LUT, Op.HardSwish) def is_split_op(self): return self in (Op.Split, Op.SplitV, Op.StridedSlice, Op.Slice, Op.UnpackReshaped, Op.Unpack) @@ -372,6 +372,8 @@ def create_activation_function(op_type: Op) -> ActivationFunction: elif op_type == Op.Sigmoid: act.min = 0.0 act.max = 1.0 + elif op_type == Op.HardSwish: + act.min = 0.0 return act -- cgit v1.2.1