Skip to content

[DOC] print and clip api, test=develop#2714

Merged
zhupengyang merged 9 commits intoPaddlePaddle:developfrom
qili93:print_clip_api_doc
Sep 30, 2020
Merged

[DOC] print and clip api, test=develop#2714
zhupengyang merged 9 commits intoPaddlePaddle:developfrom
qili93:print_clip_api_doc

Conversation

@qili93
Copy link
Contributor

@qili93 qili93 commented Sep 28, 2020

Change the code samples of the following API:

  • paddle.static.Print
  • paddle.nn.GradientClipByValue
  • paddle.nn.GradientClipByNorm
  • paddle.nn.GradientClipByGlobalNorm

Corresponding Paddle PR: PaddlePaddle/Paddle#27670

@paddle-bot-old
Copy link

Thanks for your contribution!

@qili93
Copy link
Contributor Author

qili93 commented Sep 28, 2020

image

image

image

image

@qili93
Copy link
Contributor Author

qili93 commented Sep 29, 2020

image
image
image
image


.. code-block:: python

import paddle.fluid as fluid
Copy link
Collaborator

Choose a reason for hiding this comment

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

上面的Variable -> Tensor
不用单独写返回类型~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

确认过,静态图还是Variable,不用修改

Copy link
Contributor Author

Choose a reason for hiding this comment

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

返回类型已删

- **need_clip** (function, optional) - 类型: 函数。用于指定需要梯度裁剪的参数,该函数接收一个 ``Parameter`` ,返回一个 ``bool`` (True表示需要裁剪,False不需要裁剪)。默认为None,此时会裁剪网络中全部参数。

**代码示例1:静态图**
**代码示例1:动态图**
Copy link
Collaborator

Choose a reason for hiding this comment

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

代码改动同英文~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@TCChenlong TCChenlong left a comment

Choose a reason for hiding this comment

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

LGTM

@qili93 qili93 changed the title update samples of print and clip api, test=develop [DOC] print and clip api, test=develop Sep 30, 2020
@zhupengyang zhupengyang merged commit daba8d2 into PaddlePaddle:develop Sep 30, 2020
@qili93 qili93 deleted the print_clip_api_doc branch September 30, 2020 05:39
RichardWooSJTU pushed a commit to RichardWooSJTU/docs that referenced this pull request Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants