PyTorch torch.deg2rad Function
PyTorch torch Reference Manual
torch.deg2radIs a function in PyTorch used to convert angles to radians.
Function Definition
torch.deg2rad(input, *, out=None)
Usage Example
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])
# 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])
Other Extensions