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] reformat example code with google style in No.150-160 #56178

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Aug 11, 2023

PR types

Others

PR changes

Others

Description

150 | python/paddle/text/datasets/wmt16.py
151 | python/paddle/text/viterbi_decode.py
152 | python/paddle/vision/models/_utils.py
153 | python/paddle/vision/models/alexnet.py
154 | python/paddle/vision/models/densenet.py
155 | python/paddle/vision/models/googlenet.py
156 | python/paddle/vision/models/inceptionv3.py
157 | python/paddle/vision/models/lenet.py
158 | python/paddle/vision/models/mobilenetv1.py
159 | python/paddle/vision/models/mobilenetv2.py
160 | python/paddle/vision/models/mobilenetv3.py

预览:

en: http://preview-paddle-pr-56178.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/en/api/paddle/abs_en.html
zh: http://preview-paddle-pr-56178.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/abs_cn.html

关联 PR:
#55629
#55295

@sunzhongkai588 @SigureMo @megemini

@paddle-bot
Copy link

paddle-bot bot commented Aug 11, 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 11, 2023
@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Aug 11, 2023
[54] [43] [44]
[217] [30] [31]
[146] [51] [52]
[55] [24] [25]
Copy link
Member

Choose a reason for hiding this comment

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

image

0D 支持后,shape 应该不再是 [1] 了,可以用最新的 develop 试一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到!

... def forward(self, src_ids, trg_ids, trg_ids_next):
... return paddle.sum(src_ids), paddle.sum(trg_ids), paddle.sum(trg_ids_next)
...
>>> paddle.disable_static()
Copy link
Member

Choose a reason for hiding this comment

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

默认动态图应该不需要这一行了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到

Comment on lines 140 to 141
[[0, 0],
[1, 1]])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[[0, 0],
[1, 1]])
[[0, 0],
[1, 1]])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到

Comment on lines 63 to 70
>>> import paddle
>>> m = paddle.vision.models.resnet18(pretrained=False)
>>> # extract layer1 and layer3, giving as names `feat1` and feat2`
>>> new_m = paddle.vision.models._utils.IntermediateLayerGetter(m,
... {'layer1': 'feat1', 'layer3': 'feat2'})
>>> out = new_m(paddle.rand([1, 3, 224, 224]))
>>> print([(k, v.shape) for k, v in out.items()])
[('feat1', [1, 64, 56, 56]), ('feat2', [1, 256, 14, 14])]
Copy link
Member

Choose a reason for hiding this comment

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

整体缩进层级 +1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到


# build mobilenet v2 with scale=0.5
>>> # Build mobilenet v2 with scale=0.5
model = mobilenet_v2(scale=0.5)
Copy link
Member

Choose a reason for hiding this comment

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

这咋跑输出行了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

收到

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 ~ 赞~

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 merged commit 5356f2e into PaddlePaddle:develop Aug 17, 2023
@enkilee enkilee deleted the xdoctest-150-160 branch December 19, 2023 05:33
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