PyTorch torch.sigmoid Function
Pytorch torch Reference Manual
torch.sigmoidIt is the function in PyTorch used to compute the element-wise sigmoid function. The sigmoid function is defined as 1/(1+exp(-x)).
Function Definition
torch.sigmoid(input, out=None)
Usage Example
Example
import torch
# Compute sigmoid function
x = torch.tensor([0.0, 1.0, -1.0])
result = torch.sigmoid(x)
print(result)
# Compute sigmoid function
x = torch.tensor([0.0, 1.0, -1.0])
result = torch.sigmoid(x)
print(result)
Other Extensions