PyTorch torch.sin function
PyTorch torch reference manual
torch.sin is a function in PyTorch used to compute the element-wise sine.
Function definition
torch.sin(input, out=None)
Usage examples
Example
import
torch
x
=
torch.
tensor
(
[
0
,
torch.
pi
/
2
,
torch.
pi
,
3
*torch.
pi
/
2
]
)
(
torch.
sin
(
x
)
)
The output is:
tensor([ 0.0000e+00, 1.0000e+00, -8.7423e-08, -1.0000e+00])