-
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][PEP585 Upgrade][BUAA][111-120] Use standard collections for type hints for 10 files in python/paddle/
#67168
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
请问Generator的import时的位置该放在哪里 |
python/paddle/reader/decorator.py
Outdated
if TYPE_CHECKING: | ||
from collections.abc import Sequence | ||
|
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.
这为啥又来一次TYPE_CHECKING
from typing import TYPE_CHECKING, Literal, Sequence | ||
from typing import TYPE_CHECKING, Literal | ||
|
||
if TYPE_CHECKING: |
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/reader/decorator.py
Outdated
@@ -20,15 +20,14 @@ | |||
import random | |||
import sys | |||
import warnings | |||
from collections.abc import Generator |
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.
这个在 type alias 里用了,不能改,运行时会挂
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/
PR-CI-SOT 还是过不了,报错: |
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.
…type hints for 10 files in `python/paddle/` (PaddlePaddle#67168) --------- Co-authored-by: gouzi <530971494@qq.com>
PR Category
User Experience
PR Types
Others
Description
python/paddle/quantization/config.py
python/paddle/reader/decorator.py
python/paddle/sparse/nn/functional/conv.py
python/paddle/sparse/nn/layer/conv.py
python/paddle/sparse/unary.py
python/paddle/tensor/array.py
python/paddle/tensor/creation.py
python/paddle/tensor/einsum.py
python/paddle/tensor/linalg.py
python/paddle/tensor/manipulation.py