mindspore.ops.atan2

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

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

返回 θ  [π,π] ,使得 input=rsin(θ),other=rcos(θ) , 其中 r=input2+other2

参数:
  • 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]