PyTorch torch.sin Function
Pytorch torch Reference Manual
torch.sinis a function in PyTorch used to compute the element-wise sine.
Function Definition
torch.sin(input, out=None)
Usage Example
Example
import torch
x = torch.tensor([0, torch.pi/2, torch.pi, 3*torch.pi/2])
print(torch.sin(x))
x = torch.tensor([0, torch.pi/2, torch.pi, 3*torch.pi/2])
print(torch.sin(x))
The output result is:
tensor([ 0.0000e+00, 1.0000e+00, -8.7423e-08, -1.0000e+00])
Other Extensions