PyTorch torch.deg2rad function
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
)
(
result
)