Skip to content
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

[xdoctest][task cleanup 376~381] reformat example code with google style #57853

Closed
wants to merge 1 commit into from

Conversation

yuchen202
Copy link
Contributor

PR types

Others

PR changes

Others

Description

清理遗留代码

修改如下文件的示例代码,使其通过 xdoctest 检查:
python/paddle/distribution/bernoulli.py
python/paddle/distribution/categorical.py
python/paddle/distribution/gumbel.py
python/paddle/hapi/dynamic_flops.py
python/paddle/hapi/model.py
python/paddle/hapi/model_summary.py

Related links
#55629
#55295
@sunzhongkai588 @SigureMo

请评审!

@paddle-bot
Copy link

paddle-bot bot commented Sep 28, 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 28, 2023
@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Oct 6, 2023

Sorry to inform you that e83c011's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Oct 9, 2023
@@ -72,6 +72,7 @@ class Bernoulli(exponential_family.ExponentialFamily):

.. code-block:: python

>>> # doctest: +REQUIRES(env:DISTRIBUTED)
Copy link
Member

Choose a reason for hiding this comment

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

376-381 是添加 SKIP reason,这些额外修改的原因是?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

那我恢复?

@@ -64,7 +65,7 @@ class Categorical(distribution.Distribution):
>>> cat = Categorical(x)
>>> cat2 = Categorical(y)

>>> # doctest: +SKIP
>>> # doctest: +SKIP('`paddle.distribution` can not run in xdoctest')
Copy link
Member

Choose a reason for hiding this comment

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

并不是说直接 xxx can not run in xdoctest 就可以了,这样和直接空着没啥区别

Copy link
Contributor Author

Choose a reason for hiding this comment

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

咋说呢,其实我是照着
#57676
来做的,不知道可否进一步指导一下?

@@ -1140,7 +1140,7 @@ class Model:
...
... model = paddle.Model(net)
... optim = paddle.optimizer.SGD(learning_rate=1e-3, parameters=model.parameters())
...

Copy link
Member

Choose a reason for hiding this comment

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

为什么要删?

@luotao1
Copy link
Contributor

luotao1 commented Oct 18, 2023

close due to the following PR is merged:

@luotao1 luotao1 closed this Oct 18, 2023
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