-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/text/datasets/wmt16.py
Outdated
[54] [43] [44] | ||
[217] [30] [31] | ||
[146] [51] [52] | ||
[55] [24] [25] |
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.
收到!
python/paddle/text/datasets/wmt16.py
Outdated
... 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() |
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.
收到
python/paddle/text/viterbi_decode.py
Outdated
[[0, 0], | ||
[1, 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.
[[0, 0], | |
[1, 1]]) | |
[[0, 0], | |
[1, 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.
收到
>>> 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])] |
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.
整体缩进层级 +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.
收到
|
||
# build mobilenet v2 with scale=0.5 | ||
>>> # Build mobilenet v2 with scale=0.5 | ||
model = mobilenet_v2(scale=0.5) |
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.
收到
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.
LGTM ~ 赞~
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
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