Skip to content
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

[Docathon][Fix System Message No.16] #58741

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Changes from 1 commit
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
8 changes: 5 additions & 3 deletions python/paddle/nn/utils/clip_grad_value_.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ def clip_grad_value_(
parameters,
clip_value,
):
r"""Clips gradient of an iterable of parameters at specified value.
r"""
Clips gradient of an iterable of parameters at specified value.
The gradient will be modified in place.
This API can only run in dynamic graph mode, not static graph mode.

Liyulingyue marked this conversation as resolved.
Show resolved Hide resolved
Args:
parameters (Iterable[paddle.Tensor] or paddle.Tensor): Tensors or a single Tensor
parameters (Iterable[paddle.Tensor]|paddle.Tensor): Tensors or a single Tensor
that will be normalized gradients
clip_value (float or int): maximum allowed value of the gradients.
clip_value (float|int): maximum allowed value of the gradients.
The gradients are clipped in the range
:math:`\left[\text{-clip\_value}, \text{clip\_value}\right]`

Expand Down