diff --git a/python/tvm/relax/frontend/onnx/onnx_frontend.py b/python/tvm/relax/frontend/onnx/onnx_frontend.py index b91106e64a91..05e4534acae3 100644 --- a/python/tvm/relax/frontend/onnx/onnx_frontend.py +++ b/python/tvm/relax/frontend/onnx/onnx_frontend.py @@ -1698,7 +1698,8 @@ class Softplus(OnnxOpConverter): @classmethod def _impl_v1(cls, bb, inputs, attr, params): dtype = inputs[0].struct_info.dtype - return relax.op.log(relax.op.exp(inputs[0]) + relax.const(1, dtype=dtype)) + threshold = 10.0 if dtype == "float16" else 20.0 + return relax.op.nn.softplus(inputs[0], threshold=threshold) class Softsign(OnnxOpConverter):