Skip to content

Commit

Permalink
[Docathon][Fix System Message No.16] (PaddlePaddle#58741)
Browse files Browse the repository at this point in the history
* Update clip_grad_value_.py

* Apply suggestions from code review

* Update clip_grad_value_.py
  • Loading branch information
Liyulingyue authored and SecretXV committed Nov 28, 2023
1 parent f9fea88 commit 8d6dc30
Showing 1 changed file with 5 additions and 3 deletions.
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.
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

0 comments on commit 8d6dc30

Please sign in to comment.