PyTorch torch.deg2rad Function

PyTorch torch.deg2rad Function


Pytorch torch 参考手册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])

Pytorch torch 参考手册PyTorch torch Reference Manual

Other Extensions