-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[xdoctest] reformat example code with google style in No. 100 #55967
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -51,19 +51,19 @@ def _stride_column(param): | |||
|
|||
Examples: | |||
.. code-block:: python | |||
>>> # doctest: +SKIP('module paddle.nn.utils has no attribute stride_column') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就用 paddle.nn.utils._stride_column
>>> paddle.seed(2023) | ||
>>> linear = paddle.nn.Linear(10, 15) | ||
|
||
>>> paddle.nn.utils.parameters_to_vector(linear.parameters()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来示例代码只展示了 shape,这里也只打印 shape 即可
[[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.], | ||
[3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3., 3.]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以使用 ...
么
在死丢丢环境中运行结果和ci输出不一致,麻烦看一下@SigureMo |
Sorry to inform you that dbced39's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMeow 🐾
…Paddle#55967) * Update backend.py * transform_parameters * Update transform_parameters.py * Update transform_parameters.py * Update transform_parameters.py * Update transform_parameters.py * Update python/paddle/nn/utils/transform_parameters.py * Apply suggestions from code review * Apply suggestions from code review
PR types
Others
PR changes
Others
Description
#55629