Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.sin function

PyTorch torch.sin function


PyTorch torch reference manual 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

]

)

print

(

torch.

sin

(

x

)

)

The output is:

tensor([ 0.0000e+00,  1.0000e+00, -8.7423e-08, -1.0000e+00])


PyTorch torch reference manual PyTorch torch reference manual