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

为 Paddle 框架 API 添加类型提示(Type Hints)Tracking Issue #63597

Closed
16 tasks done
megemini opened this issue Apr 17, 2024 · 1 comment
Closed
16 tasks done
Assignees
Labels
PaddlePaddle Hackathon PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭

Comments

@megemini
Copy link
Contributor

megemini commented Apr 17, 2024

任务简介

为 Paddle 框架 API 添加类型提示(Type Hints)

Python 在 3.0 版本引入了类型提示功能,并在 PEP 484 中将其规范化。之后随着相关规范和工具的逐渐完善,类型提示逐渐成为 Python 代码中的标准实践,如今较新的主流库也基本都提供了类型提示。由于 Python 本身类型高度动态化,类型提示的存在可以帮助开发者更快地了解代码的类型信息,提高代码的可读性和可维护性,结合工具还可以提供静态类型检查,在开发阶段就能发现一些潜在的类型错误。Paddle 框架由于历史原因尚未提供类型提示,本任务希望引入尽可能多的对 Paddle 有利的类型提示。

更多信息参考 为 Paddle 框架 API 添加类型提示(Type Hints)

RFC

🏗️ 第一阶段 前置任务 (2024/04/22 ~)

  • 1-1. Paddle 中引入 _typing 模块
  • 1-2. Paddle 中引入 Tensor stub 和 Paddle/python/paddle/py.typed 文件
  • 1-3. Paddle 的 docs 中引入文档 《Paddle 中的类型提示》
  • 1-4. Paddle 的 CI 中引入 mypy 对于 API 中 docstring 的 示例代码 的类型检查
  • 1-5. Paddle 的 docs 中正确的显示函数签名与描述的数据类型
  • 1-6. Paddle 的 docs 中不渲染 # type: ignore
任务列表
任务编号 认领人 github id 任务 PR
1-1 @Asthestarsfalll @SigureMo #63604 #63690
1-2 @megemini #63953 #64575
1-3 @megemini @SigureMo PaddlePaddle/docs#6678 PaddlePaddle/docs#6836
1-4 @megemini #63901
1-5 @megemini PaddlePaddle/docs#6676
1-6 @megemini PaddlePaddle/docs#6680

🔜 第二阶段 代码标注

任务列表
任务编号 认领人 github id 任务 PR
2-1 @megemini
2-2 @megemini PaddlePaddle/docs#6678

🔜 第三阶段 补充测试 (推荐)

  • 3-1. CI 全量检查示例代码;CI 默认进行 type checking (all) ; 更新 mypy 版本
  • 3-2. 单元测试文件,或补充测试 (_typing 模块等)
任务列表
任务编号 认领人 github id 任务 PR
3-1 @megemini #67673
3-2 @megemini #65740

🔜 第四阶段 收尾

  • 4-1. 私有 API ,如 _C_ops
  • 4-2. 查缺补漏
  • 4-3. 将 tools 中的单测统一放到 test 中进行管理
  • 4-4. 任务总结,PPT,答辩
任务列表
任务编号 认领人 github id 任务 PR
4-1 @megemini #66357
4-2 @megemini #65397
4-3 @megemini #65905
4-4 @megemini PFCCLab/blog#68

认领方式

请大家以 comment 的形式认领任务,如:

【认领】1-1

@SigureMo @zrr1999 @Asthestarsfalll @gsq7474741 @sunzhongkai588 @luotao1

请悉知~ :)

@Asthestarsfalll
Copy link
Contributor

【认领】1-1

@luotao1 luotao1 moved this to In Progress in Call for Contributions Apr 17, 2024
@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Apr 17, 2024
@luotao1 luotao1 closed this as completed Sep 5, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Call for Contributions Sep 5, 2024
@paddle-bot paddle-bot bot added the status/close 已关闭 label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PaddlePaddle Hackathon PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭
Projects
Development

No branches or pull requests

6 participants