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

PyTorch torch.deg2rad function

PyTorch torch.deg2rad function

PyTorch torch.deg2rad function


PyTorch torch reference manual PyTorch torch reference manual

torch.deg2rad is a PyTorch function for converting angles to radians.

Function definition

torch.deg2rad(input, *, out=None)


Usage examples

Example

import

torch

Angle-to-radian conversion example

x

=

torch.

tensor

(

[

0

,

90

,

180

,

270

,

360

]

,

dtype

=

torch.

float32

)

result

=

torch.

deg2rad

(

x

)

print

(

result

)

 

tensor([0.0000, 1.5708, 3.1416, 4.7124, 6.2832])


PyTorch torch reference manual PyTorch torch reference manual