oneflow.nn.functional.silu

oneflow.nn.functional.silu(x: Tensor)Tensor

The formula is:

\[ext{silu}(x) = x * sigmoid(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.silu(input)
>>> out
tensor([0.7311, 1.7616, 2.8577], dtype=oneflow.float32)

See SiLU for more details.