-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[xdoctest] reformat example code with google style in No.344-No.352 #57134
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提交成功,感谢你对开源项目的贡献! |
>>> import paddle | ||
>>> import paddle.base as base | ||
>>> import numpy as np | ||
|
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.enable_static()
>>> import paddle | ||
>>> import paddle.base as base | ||
>>> import numpy as np |
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.enable_static()
>>> import paddle | ||
>>> import paddle.base as base | ||
>>> import numpy as np |
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.enable_static()
python/paddle/base/log_helper.py
Outdated
>>> import paddle | ||
>>> from paddle.base import log_helper | ||
|
||
>>> logger = log_helper.get_logger(__name__, logging.INFO, | ||
... fmt='%(asctime)s-%(levelname)s: %(message)s') |
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.
import logging
python/paddle/base/unique_name.py
Outdated
>>> name1 = paddle.utils.unique_name.generate('fc') | ||
>>> name2 = paddle.utils.unique_name.generate('fc') | ||
>>> print(name1, name2) | ||
fc_0, fc_1 |
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.
没有逗号
python/paddle/base/unique_name.py
Outdated
>>> name1 = paddle.utils.unique_name.generate('fc') | ||
>>> name2 = paddle.utils.unique_name.generate('fc') | ||
>>> print(name1, name2) | ||
fc_0, fc_1 |
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.
没有逗号
python/paddle/base/unique_name.py
Outdated
>>> import paddle | ||
>>> with paddle.utils.unique_name.guard(): | ||
... name_1 = paddle.utils.unique_name.generate('fc') | ||
>>> with paddle.utils.unique_name.guard(): | ||
... name_2 = paddle.utils.unique_name.generate('fc') | ||
>>> print(name_1, name_2) | ||
fc_0, fc_0 | ||
|
||
>>> with paddle.utils.unique_name.guard('A'): | ||
... name_1 = paddle.utils.unique_name.generate('fc') | ||
>>> with paddle.utils.unique_name.guard('B'): | ||
... name_2 = paddle.utils.unique_name.generate('fc') | ||
>>> print(name_1, name_2) | ||
Afc_0, Bfc_0 |
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.
没有逗号
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 🐾
PR types
Others
PR changes
Others
Description
修改如下文件的示例代码为新的格式,并通过 xdoctest 检查:
其中:
python/paddle/base/layers/nn.py和python/paddle/base/optimizer.py已经被删除;
python/paddle/base/layers/tensor.py文件为空,后面可以考虑删除该文件;
@sunzhongkai588 @SigureMo @megemini