Shortcuts

torch.atan2

torch.atan2(input, other, *, out=None) 张量

逐元素的反正切值 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坐标。)

The shapes of input and other must be 可广播的.

Parameters
  • 输入 (张量) – 第一个输入张量

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

Keyword Arguments

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

示例:

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