-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[xdoctest][task 198-199] reformat example code with google style in tensor/*
#56186
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
麻烦使用非 fluid API 替换下 fluid API,因为 fluid 即将移除,任何用到 fluid 的代码将会无法运行
python/paddle/tensor/attribute.py
Outdated
import numpy as np | ||
import paddle | ||
paddle.enable_static() | ||
>>> import paddle.fluid as fluid |
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.fluid as fluid |
python/paddle/tensor/attribute.py
Outdated
|
||
exe = fluid.Executor(fluid.CPUPlace()) | ||
exe.run(fluid.default_startup_program()) | ||
>>> exe = fluid.Executor(fluid.CPUPlace()) |
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.
fluid.Executor
-> paddle.static.Executor
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.
fluid.CPUPlace
-> paddle.CPUPlace
python/paddle/tensor/attribute.py
Outdated
exe = fluid.Executor(fluid.CPUPlace()) | ||
exe.run(fluid.default_startup_program()) | ||
>>> exe = fluid.Executor(fluid.CPUPlace()) | ||
>>> exe.run(fluid.default_startup_program()) |
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.
fluid.default_startup_program
-> paddle.static.default_startup_program
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.
我这里试的是没问题啊,也许是旧的 convert-doctest 的问题?可以装一下最新的试试,或者直接提交上来看看 CI 能不能过
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.
是我自己代码改错了,不是convert-doctset问题,代码对了是可以通过的
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 ~ 赞!
…tensor/*` (PaddlePaddle#56186) * [Doctest]fix No.198-199, test=docs_preview * [Doctest]fix No.199, test=docs_preview * abandon fluid * fix () * fix code
PR types
Others
PR changes
Others
Description
修改如下文件的示例代码,使其通过
xdoctest
检查:python/paddle/tensor/array.py
python/paddle/tensor/attribute.py
预览:
Related links
@sunzhongkai588 @SigureMo @megemini