torch.rad2deg¶
- torch.rad2deg(input: Tensor, *, out: Optional[Tensor]) Tensor ¶
将
input
中的每个元素从弧度转换为度,并返回新的张量。- 参数:
input (Tensor) – 输入张量。
- 关键字参数:
输出(张量,可选)- 输出张量。
示例:
>>> a = torch.tensor([[3.142, -3.142], [6.283, -6.283], [1.570, -1.570]]) >>> torch.rad2deg(a) tensor([[ 180.0233, -180.0233], [ 359.9894, -359.9894], [ 89.9544, -89.9544]])