Skip to content

Commit b757028

Browse files
authored
【Hackathon No.8】add docs for api hypot & hypot_ (#6230)
* Update Overview_cn.rst * add overview * add hypot rst * add hypot rst * Update hypot_cn.rst * add hypot_ rst
1 parent 84a39dd commit b757028

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

docs/api/paddle/Overview_cn.rst

+2
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ tensor 数学操作
153153
" :ref:`paddle.i1 <cn_api_paddle_i1>` ", "对输入 Tensor 每个元素计算第一类一阶修正贝塞尔函数"
154154
" :ref:`paddle.i1e <cn_api_paddle_i1e>` ", "对输入 Tensor 每个元素计算第一类指数缩放的一阶修正贝塞尔函数"
155155
" :ref:`paddle.polygamma <cn_api_paddle_polygamma>` ", "对输入 Tensor 每个元素计算多伽马函数"
156+
" :ref:`paddle.hypot <cn_api_paddle_hypot>` ", "对输入 直角三角形的直角边 Tensor x, y, 计算其斜边"
156157
.. _tensor_math_inplace:
157158

158159
tensor 数学操作原位(inplace)版本
@@ -181,6 +182,7 @@ tensor 数学操作原位(inplace)版本
181182
" :ref:`paddle.tanh_ <cn_api_paddle_tan_>` ", "Inplace 版本的 tan API,对输入 x 采用 Inplace 策略"
182183
" :ref:`paddle.uniform_ <cn_api_paddle_uniform_>` ", "Inplace 版本的 uniform API,对输入 x 采用 Inplace 策略"
183184
" :ref:`paddle.lerp_ <cn_api_paddle_lerp_>` ", "Inplace 版本的 lerp API,对输入 x 采用 Inplace 策略"
185+
" :ref:`paddle.hypot_ <cn_api_paddle_hypot_>` ", "Inplace 版本的 hypot API,对输入 x 采用 Inplace 策略"
184186

185187
.. _tensor_logic:
186188

docs/api/paddle/Tensor/Overview_en.rst

+2
Original file line numberDiff line numberDiff line change
@@ -275,3 +275,5 @@ Methods
275275
trapezoid
276276
cumulative_trapezoid
277277
vander
278+
hypot
279+
hypot_

docs/api/paddle/hypot__cn.rst

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. _cn_api_paddle_hypot_:
2+
3+
hypot\_
4+
-------------------------------
5+
6+
.. py:function:: paddle.hypot_(x, y, name=None)
7+
8+
Inplace 版本的 :ref:`cn_api_paddle_hypot` API,对输入 x 采用 Inplace 策略。
9+
10+
更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。
11+
12+
.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3

docs/api/paddle/hypot_cn.rst

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. _cn_api_paddle_hypot:
2+
3+
hypot
4+
-------------------------------
5+
6+
.. py:function:: paddle.hypot(x, y, name=None)
7+
8+
9+
`hypot` 函数对于给定直角三角形直角边 `x`, `y` 实现斜边长度求解的计算;
10+
11+
.. math::
12+
out= \sqrt{x^2 + y^2}
13+
14+
参数
15+
::::::::::
16+
- **x** (Tensor) – 输入Tensor,它的数据类型可以是 float32,float64, int32, int64。
17+
- **y** (Tensor) – 输入 Tensor,它的数据类型可以是 float32,float64,int32, int64。
18+
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。
19+
返回
20+
::::::::::
21+
- ``out`` (Tensor):一个 n-d Tensor。如果 x、y 具有不同的形状并且是可广播的,则得到的张量形状是广播后 x 和 y 的形状。如果 x、y 具有相同的形状,则其形状与 x 和 y 相同。
22+
23+
24+
代码示例
25+
::::::::::
26+
27+
COPY-FROM: paddle.hypot

0 commit comments

Comments
 (0)