Skip to content

Fix typo in grad_scaler.py #72657

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 1 commit into from
May 12, 2025
Merged
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
6 changes: 3 additions & 3 deletions python/paddle/amp/grad_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def is_use_dynamic_loss_scaling(self) -> bool:
Whether to use dynamic loss scaling.

Returns:
bool: if fixed loss_scaling is used return False, if the loss scaling is updated dynamically return true.
bool: if fixed loss_scaling is used return False, if the loss scaling is updated dynamically return True.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -1213,7 +1213,7 @@ def get_decr_every_n_nan_or_inf(self) -> int:
Return the num `n`, `n` represent decreases loss scaling every `n` accumulated steps with nan or inf gradients.

Returns:
int: the num `n`, `n` represent decreases loss scaling every `n` accumulated steps with nan or inf gradients.
int: the num `n`, `n` represent decreases loss scaling every `n` accumulated steps with nan or inf gradients.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -1308,7 +1308,7 @@ def load_state_dict(self, state_dict: _ScaleStateDict) -> None:
Loads the scaler state.

Args:
state_dict(dict): scaler state. Should be an object returned from a call to `GradScaler.state_dict()`.
state_dict(dict): scaler state. Should be an object returned from a call to `GradScaler.state_dict()`.

Examples:

Expand Down