2022-07-12 13:50:33 +08:00
|
|
|
|
mindspore.ops.atan2
|
|
|
|
|
|
===================
|
|
|
|
|
|
|
2023-02-14 11:10:08 +08:00
|
|
|
|
.. py:function:: mindspore.ops.atan2(input, other)
|
2022-07-12 13:50:33 +08:00
|
|
|
|
|
2023-02-14 11:10:08 +08:00
|
|
|
|
逐元素计算input/other的反正切值。
|
2022-07-12 13:50:33 +08:00
|
|
|
|
|
2023-02-14 11:10:08 +08:00
|
|
|
|
返回 :math:`\theta\ \in\ [-\pi, \pi]` ,使得 :math:`input = r*\sin(\theta), other = r*\cos(\theta)` ,其中 :math:`r = \sqrt{input^2 + other^2}` 。
|
2023-02-04 15:45:17 +08:00
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
- 参数 `input` 和 `other` 遵循 `隐式类型转换规则 <https://www.mindspore.cn/docs/zh-CN/master/note/operator_list_implicit.html>`_ ,使数据类型保持一致。如果两参数数据类型不一致,则低精度类型会被转换成较高精度类型。
|
|
|
|
|
|
- 输入必须是两个Tensor,或一个Tensor和一个Scalar。
|
|
|
|
|
|
- 当输入是一个Tensor和一个Scalar时,Scalar只能是一个常数。
|
2022-07-12 13:50:33 +08:00
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
参数:
|
2023-02-14 19:22:27 +08:00
|
|
|
|
- **input** (Tensor, Number.number) - 输入Tensor或常数,shape: :math:`(N,*)` ,其中 :math:`*` 表示任何数量的附加维度。
|
|
|
|
|
|
- **other** (Tensor, Number.number) - 输入Tensor或常数,shape应能在广播后与 `input` 相同,或 `input` 的shape在广播后与 `other` 相同。
|
2022-07-12 13:50:33 +08:00
|
|
|
|
|
2023-02-23 16:54:19 +08:00
|
|
|
|
.. note::
|
|
|
|
|
|
两个参数中,至少有一个需要为Tensor。
|
2023-02-20 14:32:30 +08:00
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
返回:
|
2023-02-14 19:22:27 +08:00
|
|
|
|
Tensor或常数,与广播后的输入shape相同,和 `input` 数据类型相同。
|
2022-07-12 13:50:33 +08:00
|
|
|
|
|
2022-07-25 15:09:45 +08:00
|
|
|
|
异常:
|
2023-02-14 19:22:27 +08:00
|
|
|
|
- **TypeError** - `input` 或 `other` 不是Tensor或常数。
|
2023-02-14 11:10:08 +08:00
|
|
|
|
- **RuntimeError** - `input` 与 `other` 之间的数据类型转换不被支持。
|