-
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
[Typing][C-50] Add type annotations for python/paddle/distributed/fleet/utils/ps_util.py
#66770
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
from paddle import Tensor | ||
from paddle.base import Executor | ||
from paddle.distributed.fleet.base.role_maker import RoleMakerBase | ||
from paddle.framework import 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.
from paddle.framework import Program | |
from paddle.static import Program |
paddle.framework.Program
不是公开 API,而且运行时有点细微差异,比如说 PIR 模式下并没有给 paddle.framework.Program
patch 成 PIR 的 Program,虽然 patch 这种行为本身类型检查工具也不可能检查出来就是了……
|
||
import paddle | ||
|
||
if TYPE_CHECKING: | ||
from paddle import Tensor | ||
from paddle.base import 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.
from paddle.base import Executor | |
from paddle.static import 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.
…eet/utils/ps_util.py` (PaddlePaddle#66770) --------- Co-authored-by: SigureMo <sigure.qaq@gmail.com>
PR Category
User Experience
PR Types
Improvements
Description
类型标注:
python/paddle/distributed/fleet/utils/ps_util.py
Related links
@SigureMo @megemini