Skip to content

[Docathon][Add Inplace CN Doc No.19-22] #7131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/api/paddle/Overview_cn.rst
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ paddle 目录下包含 tensor、device、framework 相关 API 以及某些高层
- :ref:`tensor 数学操作 <tensor_math>`
- :ref:`tensor 数学操作原位(inplace)版本 <tensor_math_inplace>`
- :ref:`tensor 逻辑操作 <tensor_logic>`
- :ref:`tensor 逻辑操作原位(inplace)版本 <tensor_logic_inplace>`
- :ref:`tensor 属性相关 <tensor_attribute>`
- :ref:`tensor 创建相关 <tensor_creation>`
- :ref:`tensor 元素查找相关 <tensor_search>`
Expand Down Expand Up @@ -178,6 +179,7 @@ tensor 数学操作
" :ref:`paddle.combinations <cn_api_paddle_combinations>` ", "对输入 Tensor 计算长度为 r 的情况下的所有组合"
" :ref:`paddle.select_scatter <cn_api_paddle_select_scatter>` ", "根据 axis 和 index(整数) 填充 value 值至输入 Tensor"
" :ref:`paddle.reduce_as <cn_api_paddle_reduce_as>` ", "对 x 在某些维度上求和,使其结果与 target 的 shape 一致"

.. _tensor_math_inplace:

tensor 数学操作原位(inplace)版本
Expand All @@ -204,7 +206,6 @@ tensor 数学操作原位(inplace)版本
" :ref:`paddle.cumprod_ <cn_api_paddle_cumprod_>` ", "Inplace 版本的 cumprod API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.cumsum_ <cn_api_paddle_cumsum_>` ", "Inplace 版本的 cumsum API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.divide_ <cn_api_paddle_divide_>` ", "Inplace 版本的 divide API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.equal_ <cn_api_paddle_equal_>` ", "Inplace 版本的 equal API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.exp_ <cn_api_paddle_exp_>` ", "Inplace 版本的 exp API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.expm1_ <cn_api_paddle_expm1_>` ", "Inplace 版本的 expm1 API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.flatten_ <cn_api_paddle_flatten_>` ", "Inplace 版本的 flatten API,对输入 x 采用 Inplace 策略"
Expand Down Expand Up @@ -250,6 +251,8 @@ tensor 数学操作原位(inplace)版本
" :ref:`paddle.normal_ <cn_api_paddle_normal_>` ", "Inplace 版本的 normal API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.neg_ <cn_api_paddle_neg_>` ", "Inplace 版本的 neg API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.nan_to_num_ <cn_api_paddle_nan_to_num_>` ", "Inplace 版本的 nan_to_num API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.i0_ <cn_api_paddle_i0_>` ", "Inplace 版本的 i0 API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.lcm_ <cn_api_paddle_lcm_>` ", "Inplace 版本的 lcm API,对输入 x 采用 Inplace 策略"



Expand All @@ -272,6 +275,20 @@ tensor 逻辑操作
" :ref:`paddle.isneginf <cn_api_paddle_isneginf>` ", "返回输入 tensor 的每一个值是否为 -INF"
" :ref:`paddle.isreal <cn_api_paddle_isreal>` ", "返回输入 tensor 的每一个值是否为实数类型"

.. _tensor_logic_inplace:

tensor 逻辑操作原位(inplace)版本
::::::::::::::::::::

.. csv-table::
:header: "API 名称", "API 功能"
:widths: 10, 30

" :ref:`paddle.equal_ <cn_api_paddle_equal_>` ", "Inplace 版本的 equal API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.greater_equal_ <cn_api_paddle_greater_equal_>` ", "Inplace 版本的 greater_equal API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.greater_than_ <cn_api_paddle_greater_than_>` ", "Inplace 版本的 greater_than API,对输入 x 采用 Inplace 策略"


.. _tensor_attribute:

tensor 属性相关
Expand Down
11 changes: 11 additions & 0 deletions docs/api/paddle/greater_equal__cn.rst
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

统一一下 inplace 文档的描述,可以参考其他 PR 的写法。如 #7151

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修正并推送,望您查阅。

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _cn_api_paddle_greater_equal_:

greater\_equal\_
-------------------------------

.. py:function:: paddle.greater_equal_(x, y, name=None)
Inplace 版本的 :ref:`cn_api_paddle_greater_equal` API,对输入 x 采用 Inplace 策略。

更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。

.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3
11 changes: 11 additions & 0 deletions docs/api/paddle/greater_than__cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _cn_api_paddle_greater_than_:

greater\_than\_
-------------------------------

.. py:function:: paddle.greater_than_(x, y, name=None)
Inplace 版本的 :ref:`cn_api_paddle_greater_than` API,对输入 x 采用 Inplace 策略。

更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。

.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3
11 changes: 11 additions & 0 deletions docs/api/paddle/i0__cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _cn_api_paddle_i0_:

i0\_
-------------------------------

.. py:function:: paddle.i0_(x, name=None)
Inplace 版本的 :ref:`cn_api_paddle_i0` API,对输入 x 采用 Inplace 策略。

更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。

.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3
11 changes: 11 additions & 0 deletions docs/api/paddle/lcm__cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _cn_api_paddle_lcm_:

lcm\_
-------------------------------

.. py:function:: paddle.lcm_(x, y, name=None)
Inplace 版本的 :ref:`cn_api_paddle_lcm` API,对输入 x 采用 Inplace 策略。

更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。

.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3