已合并
Sync PyPTO Pro API annotations and docs #6873
xuxinlei321创建于 9 天前
Sync PyPTO Pro API annotations and docs #6873
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 xuxinlei321 的贡献)9 天前 创建了 pull request,commit 8f2441b5
atomgit-bot
9 天前 评论:
9 天前 评论:
变更摘要
本 PR 主要对 PyPTO Pro 的语言层 API 声明与文档进行同步整理,核心是统一并内联类型标注:移除 _api.py 中的 Offset、Shape 类型别名,改为在各接口签名中直接使用 Union[List[int], int]、List[int]、Sequence[int] 等显式类型;同时将 TileType 构造函数的返回值标注为具体的 TileTypeDescriptor。相应的参数类型校验与错误信息测试也同步调整,以保证声明、校验和报错保持一致。
主要改动
- 移除类型别名
Offset与Shape: 在_api.py中删除Offset = Union[List[int], int]与Shape = List[int],接口签名改为内联显式类型。 - IO/搬运类接口参数类型内联:
load、load_tile、store、store_tile的offsets/tile_offsets及move的offset改为Union[List[int], int]或Optional[Union[List[int], int]]。 TileType构造函数返回与形状参数调整: 引入TileType as TileTypeDescriptor别名,TileType返回值由Any改为TileTypeDescriptor,shape/valid_shape改为Sequence[int]。- 其余接口与元数据接口改用显式类型:
set_validshape、reinterpret、dump_data、make_tensor的shape/stride/shapes改用List[int],并为reinterpret的dtype、shape增加Optional标注。 - 校验表与错误信息同步:
_argument_checker.py从_LEAF_TYPES中移除Shape、Offset条目并更新注释,test_error_format.py中断言更新为pl.TileType: shape expects Sequence[int], got int。


不准确?
atomgit-bot
9 天前 评论:
9 天前 评论:
9 天前 添加了label:cann-cla/yes
CANN-robot
9 天前 评论:
9 天前 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| docs | ✅ lyz0328, 尹杰, gaoxiang618 (3/2) | ✅ 尹杰, lyz0328 (2/1) |
| python/pypto_pro | ✅ 尹杰, gaoxiang618 (2/2) | ✅ gaoxiang618, 尹杰 (2/1) |
| repo-cann/pypto | ✅ gaoxiang618, 尹杰 (2/2) | ✅ gaoxiang618, 尹杰 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
gcw_bTlukKC6, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了106条消息 查看更多
gaoxiang618
6 天前 评论:
6 天前 评论:
/approve
/lgtm


6 天前 添加了label:approved
6 天前 添加了label:lgtm
6 天前 合入了pull request
PR 应该避免没有描述信息,描述信息的最重要的作用是描述修改意图,应该清晰明了。例如:标题中包含了
fix标签,如果没有描述信息,就需要Review人员猜测PR具体修复了哪些内容,或者怀疑修改的必要性。如果PR和特定的Issue相关,可以单独包含一行Related Issue:放到描述信息最后。下面是一个典型的PR描述信息:
更多描述信息见:Commit Message 规范