torch.sigmoid

torch.sigmoid(input, *, out=None) → Tensor

Returns a new tensor with the sigmoid of the elements of input.

outi=11+einputi\text{out}_{i} = \frac{1}{1 + e^{-\text{input}_{i}}}
Parameters

input (Tensor) – the input tensor.

Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> a = torch.randn(4)
>>> a
tensor([ 0.9213,  1.0887, -0.8858, -1.7683])
>>> torch.sigmoid(a)
tensor([ 0.7153,  0.7481,  0.2920,  0.1458])

© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.sigmoid.html