You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "jiangjiajun (via GitHub)" <gi...@apache.org> on 2023/05/29 11:31:51 UTC

[GitHub] [tvm] jiangjiajun commented on a diff in pull request #14973: [Frontend][Paddle] [PaddlePaddle Hackathon 4] add convert support for tanhshrink and add attribute support for gelu

jiangjiajun commented on code in PR #14973:
URL: https://github.com/apache/tvm/pull/14973#discussion_r1209223563


##########
python/tvm/relay/frontend/paddlepaddle.py:
##########
@@ -829,10 +829,28 @@ def convert_gelu(g, op, block):
     """Operator converter for gelu."""
 
     x = g.get_node(op.input("X")[0])
-    out = x * (
-        _expr.const(0.5, dtype="float32")
-        + _op.erf(x * _expr.const(0.5**0.5, dtype="float32")) * _expr.const(0.5, dtype="float32")
-    )
+    approx = op.attr("approximate")

Review Comment:
   There's no need to implement `approximate` for this operator, it's a acceleration  strategy in PaddlePaddle



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org