Skip to content

Conversation

longranger2
Copy link
Contributor

PR types

Others

PR changes

Others

Description

修改如下文件的示例代码为新的格式,并通过 xdoctest 检查:

  • python/paddle/base/layers/nn.py
  • python/paddle/base/layers/tensor.py
  • python/paddle/base/lazy_init.py
  • python/paddle/base/lod_tensor.py
  • python/paddle/base/log_helper.py
  • python/paddle/base/optimizer.py
  • python/paddle/base/param_attr.py
  • python/paddle/base/reader.py
  • python/paddle/base/unique_name.py

其中:
python/paddle/base/layers/nn.py和python/paddle/base/optimizer.py已经被删除;
python/paddle/base/layers/tensor.py文件为空,后面可以考虑删除该文件;

@sunzhongkai588 @SigureMo @megemini


@paddle-bot
Copy link

paddle-bot bot commented Sep 9, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Sep 9, 2023
Comment on lines +1331 to +1334
>>> import paddle
>>> import paddle.base as base
>>> import numpy as np

Copy link
Contributor

Choose a reason for hiding this comment

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

增加 >>> paddle.enable_static()

Comment on lines +1368 to +1370
>>> import paddle
>>> import paddle.base as base
>>> import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

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

增加 >>> paddle.enable_static()

Comment on lines +1423 to +1425
>>> import paddle
>>> import paddle.base as base
>>> import numpy as np
Copy link
Contributor

Choose a reason for hiding this comment

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

增加 >>> paddle.enable_static()

Comment on lines 38 to 42
>>> import paddle
>>> from paddle.base import log_helper

>>> logger = log_helper.get_logger(__name__, logging.INFO,
... fmt='%(asctime)s-%(levelname)s: %(message)s')
Copy link
Contributor

Choose a reason for hiding this comment

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

import logging

>>> name1 = paddle.utils.unique_name.generate('fc')
>>> name2 = paddle.utils.unique_name.generate('fc')
>>> print(name1, name2)
fc_0, fc_1
Copy link
Contributor

Choose a reason for hiding this comment

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

没有逗号

>>> name1 = paddle.utils.unique_name.generate('fc')
>>> name2 = paddle.utils.unique_name.generate('fc')
>>> print(name1, name2)
fc_0, fc_1
Copy link
Contributor

Choose a reason for hiding this comment

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

没有逗号

Comment on lines 207 to 220
>>> 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
Copy link
Contributor

Choose a reason for hiding this comment

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

没有逗号

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Sep 11, 2023
@luotao1 luotao1 merged commit 02a579a into PaddlePaddle:develop Sep 11, 2023
@longranger2 longranger2 deleted the xdoctest6 branch September 13, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants