torch.deg2rad

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

返回一个新的张量,将 input 中的每个元素从度数转换为弧度。

参数

input (Tensor) – 需要输入的张量。

关键字参数

out (Tensor, 可选) – 指定输出张量。

示例:

>>> a = torch.tensor([[180.0, -180.0], [360.0, -360.0], [90.0, -90.0]])
>>> torch.deg2rad(a)
tensor([[ 3.1416, -3.1416],
        [ 6.2832, -6.2832],
        [ 1.5708, -1.5708]])
本页目录