mindspore.Tensor.sigmoid
- Tensor.sigmoid() Tensor
Computes Sigmoid of self element-wise. The Sigmoid function is defined as:
where
is an element of x.Sigmoid Function Graph:
- Returns
Tensor, with the same type and shape as the self.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> input = Tensor(np.array([1, 2, 3, 4, 5]), mindspore.float32) >>> output = Tensor.sigmoid(input) >>> print(output) [0.7310586 0.880797 0.95257413 0.98201376 0.9933072 ]