mindspore/docs/api/api_python/ops/mindspore.ops.func_atan2.rst

24 lines
1.2 KiB
ReStructuredText
Raw Normal View History

mindspore.ops.atan2
===================
.. py:function:: mindspore.ops.atan2(input, other)
逐元素计算input/other的反正切值。
返回 :math:`\theta\ \in\ [-\pi, \pi]` ,使得 :math:`input = r*\sin(\theta), other = r*\cos(\theta)` ,其中 :math:`r = \sqrt{input^2 + other^2}`
输入 `input``other` 会通过隐式数据类型转换使数据类型保持一致。如果数据类型不同,低精度的数据类型会被转换到高精度的数据类型。
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` 相同。
2023-02-20 14:32:30 +08:00
.. note::
两个参数中至少有一个需要为Tensor。
2022-07-25 15:09:45 +08:00
返回:
2023-02-14 19:22:27 +08:00
Tensor或常数与广播后的输入shape相同`input` 数据类型相同。
2022-07-25 15:09:45 +08:00
异常:
2023-02-14 19:22:27 +08:00
- **TypeError** - `input``other` 不是Tensor或常数。
- **RuntimeError** - `input``other` 之间的数据类型转换不被支持。