torch.deg2rad¶ torch.deg2rad(input, *, out=None) → 张量¶ 返回一个新的张量,其中包含将input中的每个元素从角度转换为弧度的结果。 Parameters 输入 (张量) – 输入张量。 Keyword Arguments 输出 (张量, 可选) – 输出张量。 示例: >>> 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]])