mindspore.ops.atan2

查看源文件
mindspore.ops.atan2(input, other)[源代码]

逐元素计算input/other的反正切值。

返回 \(\theta\ \in\ [-\pi, \pi]\) ,使得 \(input = r*\sin(\theta), other = r*\cos(\theta)\) , 其中 \(r = \sqrt{input^2 + other^2}\)

参数:
  • input (Tensor, Number.number) - 输入tensor或常数。

  • other (Tensor, Number.number) - 输入tensor或常数。

返回:

Tensor

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> output = mindspore.ops.atan2(mindspore.tensor([0., 1.]), mindspore.tensor([1., 1.]))
>>> print(output)
[0.        0.7853982]