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

28 lines
1.4 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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}`
.. note::
- 参数 `input` 和 `other` 遵循 `隐式类型转换规则 <https://www.mindspore.cn/docs/zh-CN/master/note/operator_list_implicit.html>`_ ,使数据类型保持一致。如果两参数数据类型不一致,则低精度类型会被转换成较高精度类型。
- 输入必须是两个Tensor或一个Tensor和一个Scalar。
- 当输入是一个Tensor和一个Scalar时Scalar只能是一个常数。
参数:
- **input** (Tensor, Number.number) - 输入Tensor或常数shape: :math:`(N,*)` ,其中 :math:`*` 表示任何数量的附加维度。
- **other** (Tensor, Number.number) - 输入Tensor或常数shape应能在广播后与 `input` 相同,或 `input` 的shape在广播后与 `other` 相同。
.. note::
两个参数中至少有一个需要为Tensor。
返回:
Tensor或常数与广播后的输入shape相同`input` 数据类型相同。
异常:
- **TypeError** - `input``other` 不是Tensor或常数。
- **RuntimeError** - `input``other` 之间的数据类型转换不被支持。