• 文档 >
  • torch >
  • torch.atan2
快捷键

torch.atan2

torch.atan2(input: Tensor, other: Tensor, *, out: Optional[Tensor]) Tensor

按元素计算 inputi/otheri\text{input}_{i} / \text{other}_{i} 的反正切,考虑象限。返回一个新张量,包含向量 (otheri,inputi)(\text{other}_{i}, \text{input}_{i}) 和向量 (1,0)(1, 0) 之间的有符号角度(以弧度为单位)。(注意, otheri\text{other}_{i} ,第二个参数,是 x 坐标,而 inputi\text{input}_{i} ,第一个参数,是 y 坐标。)

inputother 的形状必须可广播。

参数:
  • 输入(张量)- 第一个输入张量

  • 其他(张量)- 第二个输入张量

关键字参数:

输出(张量,可选)- 输出张量。

示例:

>>> a = torch.randn(4)
>>> a
tensor([ 0.9041,  0.0196, -0.3108, -2.4423])
>>> torch.atan2(a, torch.randn(4))
tensor([ 0.9833,  0.0811, -1.9743, -1.4151])

© 版权所有 PyTorch 贡献者。

使用 Sphinx 构建,主题由 Read the Docs 提供。

文档

访问 PyTorch 的全面开发者文档

查看文档

教程

深入了解初学者和高级开发者的教程

查看教程

资源

查找开发资源并获得您的疑问解答

查看资源