Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 5 additions & 5 deletions docs/api/paddle/amp/GradScaler_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ GradScaler



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

Choose a reason for hiding this comment

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

image

Git的冲突标志


``scale()`` 用于让 loss 乘上一个缩放的比例。
``unscale_()`` 用于让 loss 除去一个缩放的比例。
``step()`` 与 ``optimizer.step()`` 类似,执行参数的更新,不更新缩放比例 loss_scaling。
``update()`` 更新缩放比例。
``minimize()`` 与 ``optimizer.minimize()`` 类似,执行参数的更新,同时更新缩放比例 loss_scaling,等效与``step()``+``update()``。
``minimize()`` 与 ``optimizer.minimize()`` 类似,执行参数的更新,同时更新缩放比例 loss_scaling,等效与 ``step()``+``update()``。
Copy link
Collaborator

Choose a reason for hiding this comment

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

image


通常,GradScaler 和 ``paddle.amp.auto_cast`` 一起使用,来实现动态图模式下的"自动混合精度"。

Expand Down Expand Up @@ -43,7 +43,7 @@ scale(var)
'''''''''

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

Choose a reason for hiding this comment

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

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


**参数**

Expand All @@ -57,7 +57,7 @@ scale(var)

COPY-FROM: paddle.amp.GradScaler.scale

minimize(optimizer, *args, **kwargs)
minimize(optimizer, args, kwargs)
'''''''''

这个函数与 ``optimizer.minimize()`` 类似,用于执行参数更新。
Expand Down Expand Up @@ -288,7 +288,7 @@ load_state_dict(state_dict)

**参数**

- **state_dict** (dict) - 用于设置或更新 GradScaler 对象的属性参数,dict 需要是``GradScaler.state_dict()``的返回值。
- **state_dict** (dict) - 用于设置或更新 GradScaler 对象的属性参数,dict 需要是 ``GradScaler.state_dict()`` 的返回值。

**代码示例**

Expand Down
4 changes: 2 additions & 2 deletions docs/api/paddle/searchsorted_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ searchsorted
- **sorted_sequence** (Tensor) - 输入的 N 维或一维 Tensor,支持的数据类型:bfloat16、float16、float32、float64、int32、int64。该 Tensor 的数值在其最后一个维度递增。
- **values** (Tensor) - 输入的 N 维 Tensor,支持的数据类型:bfloat16、float16、float32、float64、int32、int64。
- **out_int32** (bool,可选) - 输出的数据类型支持 int32、int64。默认值为 False,表示默认的输出数据类型为 int64。
- **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
Collaborator

Choose a reason for hiding this comment

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

ref这里也有问题:
image


返回
Copy link
Collaborator

Choose a reason for hiding this comment

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

image Git的冲突标志

::::::::
Expand Down