XG-zheng commented on code in PR #14160:
URL: https://github.com/apache/tvm/pull/14160#discussion_r1127314997


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -1084,6 +1084,21 @@ def convert_meshgrid(g, op, block):
         g.add_node(op.output("Out")[i], out)
 
 
+def convert_mish(g, op, block):
+    """Operator converter for mish."""
+
+    x = g.get_node(op.input("X")[0])
+    dtype = infer_type(x).checked_type.dtype
+    threshold = _expr.const(op.attr("threshold"), dtype=dtype)
+    exp = _op.exp(x)
+    add = _op.add(exp, _expr.const(1.0, dtype))
+    log = _op.log(add)
+    softplus = _op.where(x > threshold, x, log)
+    tanh = _op.tanh(softplus)
+    out = _op.multiply(x, tanh)
+    g.add_node(op.output("Out")[0], out)

Review Comment:
   
![image](https://user-images.githubusercontent.com/34860978/223315739-7565f39d-9da6-422f-babf-31c20fc4e0cb.png)
   I refer to the api doc.  The softplus in the mish function does not contain 
the beta parameter. And the attribute of mish(op.attr) only contain threshold.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to