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 125-137] reformat example code with google style in static/* #56121

Merged
merged 11 commits into from
Aug 25, 2023
Merged

Conversation

DrRyanHuang
Copy link
Member

@DrRyanHuang DrRyanHuang commented Aug 9, 2023

PR types

Others

PR changes

Others

Description

修改如下文件的示例代码,使其通过 xdoctest 检查:

任务125-137

序号 行数 文件
125 129 python/paddle/static/amp/bf16/amp_lists.py
126 623 python/paddle/static/amp/bf16/amp_utils.py
127 335 python/paddle/static/amp/bf16/decorator.py
128 286 python/paddle/static/amp/debugging.py
129 945 python/paddle/static/amp/decorator.py
130 899 python/paddle/static/amp/fp16_utils.py
131 371 python/paddle/static/input.py
132 1925 python/paddle/static/io.py
133 53 python/paddle/static/log_helper.py
134 4001 python/paddle/static/nn/common.py
135 1435 python/paddle/static/nn/control_flow.py
136 264 python/paddle/static/nn/loss.py
137 569 python/paddle/static/nn/metric.py

任务125-137中还缺少

  • python/paddle/static/nn/common.py
  • python/paddle/static/nn/control_flow.py

预览:

Related links

@paddle-bot
Copy link

paddle-bot bot commented Aug 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 contributor External developers status: proposed labels Aug 9, 2023
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 10, 2023
Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

@SigureMo static 里面太多重复 name 的变量了,导致很多示例没法跑 ~

static 处理 name 在 scope.h/scope.cc 里面,python 这边还不好 hack 。

看看怎么处理?跳过?重命名?

还有,这个 name 在底层可以为 None:

    def create_var(self, *args, **kwargs):
        if in_dygraph_mode():
            var = _create_tensor(*args, **kwargs)
        else:
            var = Variable(block=self, *args, **kwargs)
            if 'initializer' in kwargs:
                kwargs['initializer'](var, self)
        return var

这里 _create_tensorVariable 的 name 都可以是 None,可是 data 方法却限制不能为 None ~

python/paddle/static/amp/bf16/amp_lists.py Outdated Show resolved Hide resolved
python/paddle/static/amp/bf16/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/amp/debugging.py Outdated Show resolved Hide resolved
python/paddle/static/amp/debugging.py Outdated Show resolved Hide resolved
python/paddle/static/amp/decorator.py Show resolved Hide resolved
python/paddle/static/input.py Outdated Show resolved Hide resolved
python/paddle/static/amp/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/io.py Show resolved Hide resolved
python/paddle/static/nn/metric.py Outdated Show resolved Hide resolved
@SigureMo
Copy link
Member

SigureMo commented Aug 14, 2023

@SigureMo static 里面太多重复 name 的变量了,导致很多示例没法跑 ~

这个回复之前没注意到,这个如果改成多进程是不是能解决呢? @megemini

@megemini
Copy link
Contributor

这个回复之前没注意到,这个如果改成多进程是不是能解决呢? @megemini

我测试的可以 ~ 所以先更新了 convert-doctest 工具,可以验证一下可行性。

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented Aug 17, 2023

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

@megemini
Copy link
Contributor

@DrRyanHuang 不好意思,这个 PR 可能要等一下,xdoctest 没法做到环境隔离,导致 static 的一些示例不能跑 ~

等这个问题解决了,可以重新跑一下 CI ~ 不好意思 ~ 😅

@SigureMo
Copy link
Member

#56400 已 merge,麻烦 merge 下最新的 develop 试试~

python/paddle/static/amp/debugging.py Outdated Show resolved Hide resolved
python/paddle/static/amp/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/nn/metric.py Outdated Show resolved Hide resolved
python/paddle/static/io.py Outdated Show resolved Hide resolved
python/paddle/static/io.py Outdated Show resolved Hide resolved
python/paddle/static/io.py Outdated Show resolved Hide resolved
Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

东西很多,辛苦了!~~~

主要问题是,paddle.static.amp.bf16 里面的一些接口怎么给改为了 fp16?!🤣

另外,一些 examples 拆分的地方,相应的 docs 注意修改一下 ~

python/paddle/static/amp/bf16/amp_lists.py Outdated Show resolved Hide resolved
python/paddle/static/amp/bf16/amp_utils.py Outdated Show resolved Hide resolved
python/paddle/static/amp/bf16/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/amp/bf16/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/amp/bf16/decorator.py Outdated Show resolved Hide resolved
python/paddle/static/amp/decorator.py Outdated Show resolved Hide resolved
Copy link
Contributor

@megemini megemini left a comment

Choose a reason for hiding this comment

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

LGTM ~ 辛苦!

反馈几个文档问题

  • ctr_metric_bundle 缺少中文文档
  • paddle.static.auc 中文文档的示例没有分开

中文
image

英文
image

@SigureMo @sunzhongkai588

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 🐾

paddle.static.auc 中文文档的示例没有分开

麻烦 @DrRyanHuang 额外提一个中文文档 PR 利用 COPY-FROM 修复一下~

本 PR 可以合入

@sunzhongkai588
Copy link
Contributor

  • ctr_metric_bundle 缺少中文文档

好的,这个我和api负责人反馈一下~

@SigureMo SigureMo closed this Aug 25, 2023
@SigureMo SigureMo reopened this Aug 25, 2023
@luotao1 luotao1 merged commit 5bfcb50 into PaddlePaddle:develop Aug 25, 2023
@DrRyanHuang DrRyanHuang deleted the xdoc branch August 25, 2023 07:21
BeingGod pushed a commit to BeingGod/Paddle that referenced this pull request Sep 9, 2023
…static/* (PaddlePaddle#56121)

* LGTM

* [Doctest]fix No.125-137, test=docs_preview

* [Doctest]fix No.125-137, test=docs_preview

* fix codestyle

* resolve conversation

* change Example

* fix example format...

* fix my stupid fp16

* fix codestyple
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.

5 participants