mindspore.ops.silu
- mindspore.ops.silu(x)[source]
Computes Sigmoid Linear Unit of input element-wise. The SiLU function is defined as:
where the Logistic Sigmoid function is defined as:
where
is an element of the x.For more details, please refer to
mindspore.nn.SiLU
.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import numpy as np >>> import mindspore >>> from mindspore import Tensor, ops >>> x = Tensor(np.array([-1, 2, -3, 2, -1]), mindspore.float16) >>> output = ops.silu(x) >>> print(output) [-0.269 1.762 -0.1423 1.762 -0.269]