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

22 lines
720 B
ReStructuredText
Raw Normal View History

2022-11-16 16:28:42 +08:00
mindspore.ops.hypot
====================
2022-11-21 15:25:51 +08:00
.. py:function:: mindspore.ops.hypot(x, other)
2022-11-16 16:28:42 +08:00
2022-11-21 15:25:51 +08:00
按元素计算以输入Tensor为直角边的三角形的斜边。
两个输入的shape需要支持广播数据类型应为float32、float64。
2022-11-16 16:28:42 +08:00
2022-12-23 11:18:37 +08:00
.. math::
out_i = \sqrt{x_i^2 + other_i^2}
2022-11-16 16:28:42 +08:00
参数:
- **x** (Tensor) - 第一个输入Tesnor。
- **other** (Tensor) - 第二个输入Tesnor。
返回:
2022-11-21 15:25:51 +08:00
Tensorshape和广播后的shape相同数据类型为两个输入数据中精度更高的。
2022-11-16 16:28:42 +08:00
异常:
- **TypeError** - 如果 `x``other` 的类型不是float32或float64。
- **ValueError** - 两个输入参数的shape不支持广播。