oneflow.softsign¶
-
oneflow.
softsign
(x: Tensor) → Tensor¶ The formula is:
\[softsign(x) = \frac{x}{1 + |x|}\]For example:
>>> import numpy as np >>> import oneflow as flow >>> x = np.array([1, 2, 3]).astype(np.float32) >>> input = flow.tensor(x) >>> out = flow.nn.functional.softsign(input) >>> out tensor([0.5000, 0.6667, 0.7500], dtype=oneflow.float32)
See
Softsign
for more details.