-
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][B-33,B-37] Add type annotations for python/paddle/amp/{amp_lists,__init__}.py
#65633
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
python/paddle/amp/amp_lists.py
Outdated
@@ -118,7 +121,7 @@ def white_list(): | |||
return white_list | |||
|
|||
|
|||
def black_list(): | |||
def black_list() -> dict[str, dict[str, Any]]: |
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.
def black_list() -> dict[str, dict[str, Any]]: | |
def black_list() -> dict[str, dict[str, set[str]]]: |
应该也还是 set[str]
的样子 ~
另外,@SigureMo 这里有必要用 TypedDict
吗?
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.
不用了吧,这又不是公开 API,这里的输入输出的「协议」让开发的人自己把握就好了,改成 TypedDict 他们反而维护不起来了
@@ -14,6 +14,9 @@ | |||
|
|||
# The set of ops that support fp16 and bf16 calculation and are considered numerically- | |||
# safe and performance-critical. These ops are always converted to fp16 or bf16. | |||
|
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.
PEP 563
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.
这俩都不是公开 API,这个文件的统计是统计错了还是漏标记公开 API 了?
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.
这俩是我这边手动添加的 ~
我这里统计的依据基本是遵循 __all__
的范围,有一些虽然没在里面,但是在 __init__.py
里面导进去了,我看挺简单的也就放进去了 ~
python/paddle/amp/amp_lists.py
、python/paddle/amp/__init__.py
python/paddle/amp/amp_lists.py
、python/paddle/amp/__init__.py
python/paddle/amp/amp_lists.py
、python/paddle/amp/__init__.py
python/paddle/amp/{amp_lists,__init__}.py
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.
…lists,__init__}.py` (PaddlePaddle#65633)
PR Category
User Experience
PR Types
Improvements
Description
B-33
B-37