Skip to content

Commit

Permalink
Remove seemingly invalid SoftPlus (apache#7189)
Browse files Browse the repository at this point in the history
- `Softplus` is added in 12/10/2020 from this apache#7089
- However, I see that there were `SoftPlus` (not the P is in capital) was already in.
According to [Onnx spec](https://github.com/onnx/onnx/blob/master/docs/Operators.md), it is `Softplus` not `SoftPlus`.
  • Loading branch information
insop authored and Tushar Dey committed Jan 20, 2021
1 parent 105a9f0 commit af57510
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,14 +932,6 @@ def _impl_v1(cls, inputs, attr, params):
return _op.tanh(_expr.const(beta) * inputs[0]) * _expr.const(alpha)


class SoftPlus(OnnxOpConverter):
"""Operator converter for SoftPlus."""

@classmethod
def _impl_v1(cls, inputs, attr, params):
return _op.log(_op.exp(inputs[0]) + _expr.const(1.0))


class Softsign(OnnxOpConverter):
"""Operator converter for Softsign."""

Expand Down Expand Up @@ -2661,7 +2653,6 @@ def _get_convert_map(opset):
"OneHot": OneHot.get_converter(opset),
# 'Hardmax'
"Softsign": Softsign.get_converter(opset),
"SoftPlus": SoftPlus.get_converter(opset),
"Gemm": Gemm.get_converter(opset),
"MatMul": MatMul.get_converter(opset),
"Mod": Mod.get_converter(opset),
Expand Down
1 change: 0 additions & 1 deletion tests/python/frontend/onnx/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,6 @@ def verify_single_ops(op, x, out_np, rtol=1e-5, atol=1e-5):
verify_single_ops("Tanh", x, np.tanh(x))
verify_single_ops("Sigmoid", x, 1 / (1 + np.exp(-x)))
verify_single_ops("Softsign", x, x / (1 + np.abs(x)))
verify_single_ops("SoftPlus", x, np.log(1 + np.exp(x)))


@tvm.testing.uses_gpu
Expand Down

0 comments on commit af57510

Please sign in to comment.