mindspore.ops.Atan2

View Source On Gitee
class mindspore.ops.Atan2[source]

Returns arctangent of x/y element-wise.

Refer to mindspore.ops.atan2() for more details.

Inputs:
  • x (Tensor) - The input tensor with shape \((N,*)\) where \(*\) means, any number of additional dimensions.

  • y (Tensor) - The input tensor. It has the same shape with x or its shape is able to broadcast with x.

Outputs:

Tensor, the shape is the same as the one after broadcasting, and the data type is same as x.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([0, 1]), mindspore.float32)
>>> y = Tensor(np.array([1, 1]), mindspore.float32)
>>> atan2 = ops.Atan2()
>>> output = atan2(x, y)
>>> print(output)
[0.        0.7853982]