[Typing][C-1,C-2,C-3] Add type annotations for python/paddle/distributed/{spawn,rpc/rpc,auto_parallel/api}.py
#67428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
User Experience
PR Types
Improvements
Description
类型标注:
python/paddle/distributed/spawn.py
python/paddle/distributed/rpc/rpc.py
python/paddle/distributed/auto_parallel/api.py
python/paddle/distributed/auto_parallel/constants.py
python/paddle/distributed/auto_parallel/strategy.py
其中,
python/paddle/distributed/auto_parallel/constants.py
把相关的
TypedDict
放到这个文件里面,以便后续维护 ~python/paddle/distributed/auto_parallel/strategy.py
这个文件里面的类,相当于把
constants.py
的dict
转换为类的属性了 ~个人感觉,在
strategy.py
里面再进行标注不太好,因为,这里面类的属性基本是动态的,后续维护不方便,需要手动同步constants.py
中的属性,但是,也没找出什么好的办法,@SigureMo 看看有什么好的处理方式?Related links
@SigureMo @megemini