Skip to content
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

Merged
merged 4 commits into from
Jul 14, 2024

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Jul 2, 2024

PR Category

User Experience

PR Types

Improvements

Description

Copy link

paddle-bot bot commented Jul 2, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Jul 2, 2024
@@ -118,7 +121,7 @@ def white_list():
return white_list


def black_list():
def black_list() -> dict[str, dict[str, Any]]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def black_list() -> dict[str, dict[str, Any]]:
def black_list() -> dict[str, dict[str, set[str]]]:

应该也还是 set[str] 的样子 ~

另外,@SigureMo 这里有必要用 TypedDict 吗?

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 563

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这俩都不是公开 API,这个文件的统计是统计错了还是漏标记公开 API 了?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这俩是我这边手动添加的 ~

我这里统计的依据基本是遵循 __all__ 的范围,有一些虽然没在里面,但是在 __init__.py 里面导进去了,我看挺简单的也就放进去了 ~

@SigureMo SigureMo changed the title [Typing][B-33、B-37] Add type annotations for python/paddle/amp/amp_lists.pypython/paddle/amp/__init__.py [Typing][B-33,B-37] Add type annotations for python/paddle/amp/amp_lists.pypython/paddle/amp/__init__.py Jul 2, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jul 3, 2024
@SigureMo SigureMo changed the title [Typing][B-33,B-37] Add type annotations for python/paddle/amp/amp_lists.pypython/paddle/amp/__init__.py [Typing][B-33,B-37] Add type annotations for python/paddle/amp/{amp_lists,__init__}.py Jul 3, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo SigureMo merged commit 16e148c into PaddlePaddle:develop Jul 14, 2024
30 of 32 checks passed
lixcli pushed a commit to lixcli/Paddle that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants