Skip to content

Conversation

Le-soleile
Copy link
Contributor

@Le-soleile Le-soleile commented Sep 20, 2025

PR types
others

PR changes
Docs

Description
Fix excessive " in the document in searchsorted_cn and GradScaler_cn.

issue : #7435
@Echo-Nie @sunzhongkai588

Copy link

paddle-bot bot commented Sep 20, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7460.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@Echo-Nie
Copy link
Contributor

  1. 本PR和 [Docathon][Fix Doc Format No.17、18] #7459 中都对 searchsorted_cn.rst 进行了修改,请再检查一下
  2. PR描述有问题?为什么是 logical_or_cn and logical_xor_cn.
image

@Le-soleile
Copy link
Contributor Author

这个PR描述已经修改为 searchsorted_cn and GradScaler_cn,谢谢您
@Echo-Nie

``step()`` 与 ``optimizer.step()`` 类似,执行参数的更新,不更新缩放比例 loss_scaling。
``update()`` 更新缩放比例。
``minimize()`` 与 ``optimizer.minimize()`` 类似,执行参数的更新,同时更新缩放比例 loss_scaling,等效与``step()``+``update()``。
``minimize()`` 与 ``optimizer.minimize()`` 类似,执行参数的更新,同时更新缩放比例 loss_scaling,等效与 ``step()``+``update()``。
Copy link
Contributor

Choose a reason for hiding this comment

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

image


将 Tensor 乘上缩放因子,返回缩放后的输出。
如果这个 :class:`GradScaler` 的实例不使用 loss scaling,则返回的输出将保持不变。
如果这个 :class: `GradScaler` 的实例不使用 loss scaling,则返回的输出将保持不变。
Copy link
Contributor

Choose a reason for hiding this comment

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

这里不用改,不然会渲染如下:
image

- **right** (bool,可选) - 根据给定 ``values`` 在 ``sorted_sequence`` 查找对应的上边界或下边界。如果 ``sorted_sequence``的值为 nan 或 inf,则返回最内层维度的大小。默认值为 False,表示在 ``sorted_sequence`` 的查找给定 ``values`` 的下边界。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **right** (bool,可选) - 根据给定 ``values`` 在 ``sorted_sequence`` 查找对应的上边界或下边界。如果 ``sorted_sequence`` 的值为 nan 或 inf,则返回最内层维度的大小。默认值为 False,表示在 ``sorted_sequence`` 的查找给定 ``values`` 的下边界。
- **name** (str,可选) - 具体用法请参见 :ref: `api_guide_Name`,一般无需设置,默认值为 None。
Copy link
Contributor

Choose a reason for hiding this comment

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

ref这里也有问题:
image

Copy link
Contributor

@Echo-Nie Echo-Nie left a comment

Choose a reason for hiding this comment

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

image

这里还存在一些问题,需要麻烦同学改一下~

在GradScaler的108-109行,需要一个回车:

image

正确样例:

image

其他地方没问题了~

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 22, 2025
已108-109行增加回车,谢谢
@Echo-Nie
@Echo-Nie
Copy link
Contributor

预览文档: GradScaler_cn ; searchsorted_cn

- **right** (bool,可选) - 根据给定 ``values`` 在 ``sorted_sequence`` 查找对应的上边界或下边界。如果 ``sorted_sequence`` 的值为 nan 或 inf,则返回最内层维度的大小。默认值为 False,表示在 ``sorted_sequence`` 的查找给定 ``values`` 的下边界。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
Copy link
Contributor

Choose a reason for hiding this comment

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

image Git的冲突标志

GradScaler 用于动态图模式下的"自动混合精度"的训练。它控制 loss 的缩放比例,有助于避免浮点数溢出的问题。这个类具有 ``scale()``、 ``unscale_()``、 ``step()``、 ``update()``、 ``minimize()``和参数的``get()/set()``等方法。
GradScaler 用于动态图模式下的"自动混合精度"的训练。它控制 loss 的缩放比例,有助于避免浮点数溢出的问题。这个类具有 ``scale()``、 ``unscale_()``、 ``step()``、 ``update()``、 ``minimize()`` 和参数的 ``get()/set()`` 等方法。
Copy link
Contributor

Choose a reason for hiding this comment

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

image

Git的冲突标志

@Echo-Nie
Copy link
Contributor

LGTM @luotao1

@luotao1 luotao1 merged commit 17d69f3 into PaddlePaddle:develop Sep 23, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants