已关闭
[Experience Request|体验需求]: [易用性专项]公共 API 文档与示例覆盖不足,48 项无实质文档、50 项支持不足、41 项无具体示例 #3787
李俊谕创建于 26 天前关闭于 18 天前
26 天前 添加了label:requirement
26 天前 将 songle1 设为负责人
26 天前 修改标题为 “[Experience Request|体验需求]: [易用性专项]公共 API 文档与示例覆盖不足,48 项无实质文档、50 项支持不足、41 项无具体示例”,原标题为“[Experience Request|体验需求]: 公共 API 文档与示例覆盖不足,48 项无实质文档、50 项支持不足、41 项无具体示例”
26 天前 修改标题为 “[Experience Request|体验需求]: [易用性专项]公共 API 文档与示例覆盖不足,48 项无实质文档、50 项支持不足、41 项无具体示例”,原标题为“[Experience Request|体验需求]: 公共 API 文档与示例覆盖不足,48 项无实质文档、50 项支持不足、41 项无具体示例”
liuxiaoxiao11
26 天前 评论:
26 天前 评论:
问题已同步研发排查中


宋乐
26 天前 评论:
26 天前 评论:
感谢您细致的梳理与复核。经排查 config、logging、error 等模块确有所述文档缺口,问题属实,我们将按清单分批补齐 48 项 API 说明及可运行示例,优先覆盖 41 项无示例 API,尽快安排修复。文档入口:https://gitcode.com/cann/pypto/blob/master/docs/zh/api/index_hiascend.md


21 天前 将 seu_chang 设为负责人
21 天前 移除了负责人 songle1
宋乐
21 天前 评论:
21 天前 评论:
@seu_chang 请排查哪些是需要补充资料的


21 天前 将 chen_chenn 设为负责人
LiuChang
21 天前 评论:
21 天前 评论:
48 项无实质文档及源码位置均为内部框架使用接口,算子开发人员不涉及。
index_add python/pypto/op/indexing.py:94
index_add_ub python/pypto/op/indexing.py:114
请vector组件确认
@chen_chenn


21 天前 关联了pull request:docs(api): Add pypto.greater and SymInt API references
20 天前 关联了pull request:docs(api): Document pypto.greater alias and SymInt type alias
dingsinuo
19 天前 评论:
19 天前 评论:
OpType 为枚举类型,文档中重点说明其语义及各取值含义即可,无需提供示例;其余 7 项标注为“无具体示例”的 API 将一并更新对应文档资料。


18 天前 关联了pull request:fix(docs): Update enum documentation and index_add examples
18 天前 关闭了 issue
18 天前 issue状态由 进行中 改变为 已完成
体验活动所处阶段
感知学习(了解基础概念、查阅开发资料等)
体验改进触点(问题出现在哪类内容或环节)
开发资料
详细描述
一批函数和类型已经能通过
pypto.xxx访问,但开发者按 API 名查不到自身说明,或者只能看到名字、签名、转发链接,仍不知道如何直接调用。示例代码和 API 文档联合检查后,仍有一批核心 API 没有可复制、可验证的具体用法。复核基线:PyPTO
2647d50711bed338e60c4462ea5d5832a9e1c720;PyPTO-GYM 示例证据只作为补充,不替代 PyPTO 文档自身的可用性。统计口径
这些数字来自不同指标,不能相加为问题总数:
216/269=80.30%,分母是 244 个顶层公共 API + 25 个场景词;48 项 = 47 项开发触点未覆盖 API +ConvBpTile。194/244=79.51%;50 项 = 上述 48 项 +SymInt+greater。后两者有语义提及,不等于自身有完整用法。176/217=81.11%,未覆盖 41 项。另一个“示例检索”指标为107/259=41.31%,分母不同。pypto.distributed不计入 244 个顶层公共 API,不在本单;README 跳转次数也不在本单。48 项无实质文档及源码位置
下表 48 项同时都属于“50 项支持不足”;除
ConvBpTile外,其余 47 项属于开发触点未覆盖清单。“同时无具体示例”列为“是”的 31 项,加上后文SymInt、greater2 项和额外 8 项,合计 41 项无具体示例。AtomicRMWModeenum.py/pypto_impl导出;C++framework/include/tilefwk/tilefwk_op.h:49AtomicTypeenum.py/pypto_impl导出;C++framework/include/tilefwk/tilefwk_op.h:620ConfigScopepython/pypto/config.py:1029ConvBpParamspython/pypto/op/convbp.py:29ConvBpTilepython/pypto/config.py:989ConvParamspython/pypto/op/conv.py:26ConvTilepython/pypto/config.py:937CubeTilepython/pypto/config.py:885FeErrorpython/pypto/error.py:111Functionpython/pypto/functions.py:24;顶层python/pypto/__init__.py:42再导出InternalErrorpython/pypto/logging.py:30;C++framework/include/core/error.h:282LogLevelpython/pypto/logging.py:30;C++framework/include/core/logging.h:54PyptoErrorpython/pypto/error.py:56SatStatuspython/pypto/__init__.py:40;C++framework/include/tilefwk/symbolic_scalar.h:35StatusTypepython/pypto/enum.py:85VerifyErrorpython/pypto/error.py:123ceildivpython/pypto/_utils.py:117;顶层python/pypto/__init__.py:37再导出checkpython/pypto/logging.py:73check_typepython/pypto/_utils.py:89convert_to_elementpython/pypto/op/creation.py:25copysignpython/pypto/op/math.py:2242get_current_functionpython/pypto/functions.py:298get_current_scopepython/pypto/config.py:821get_global_configpython/pypto/config.py:827get_last_functionpython/pypto/functions.py:274get_log_levelpython/pypto/logging.py:107get_options_treepython/pypto/config.py:880get_scatter_modepython/pypto/op/indexing.py:424internal_checkpython/pypto/logging.py:79log_debugpython/pypto/logging.py:37log_errorpython/pypto/logging.py:55log_eventpython/pypto/logging.py:67log_fatalpython/pypto/logging.py:61log_infopython/pypto/logging.py:43log_warnpython/pypto/logging.py:49mrgsortpython/pypto/op/comparison.py:412;Tensor 方法python/pypto/tensor.py:848optionspython/pypto/config.py:770platformpython/pypto/platform.py:30的_Platform()实例;顶层python/pypto/__init__.py:38导入raise_errorpython/pypto/logging.py:85set_log_levelpython/pypto/logging.py:100set_optionspython/pypto/config.py:839set_print_optionspython/pypto/config.py:221sort32python/pypto/op/comparison.py:382;Tensor 方法python/pypto/tensor.py:844source_locationpython/pypto/_utils.py:143to_sympython/pypto/_utils.py:77to_symspython/pypto/_utils.py:85uniform_implpython/pypto/op/random.py:25verifypython/pypto/runtime.py:100;顶层python/pypto/__init__.py:39再导出日志族不是不存在的接口:
python/pypto/logging.py:11-25的__all__明确导出它们,顶层python/pypto/__init__.py:44执行from .logging import *。支持不足、但不在 48 项零实质文档集合中的 2 项
SymIntpython/pypto/symbolic_scalar.py:17pypto-loop.md:28-47、pypto-loop_unroll.md:28-35等作为参数类型出现,但没有自身定义和直接用法页greaterpython/pypto/op/comparison.py:23;Tensor 方法python/pypto/tensor.py:718examples/**/*.py中pypto.greater为 0 命中因此支持不足集合为
48 + 2 = 50项,而不是把 47、48、50 相互替换。另外 8 项只有“无具体示例”缺口的核心 API
这些 API 不属于上述 50 项文档支持不足集合,但在双仓代码示例和 API 文档联合判定中仍无具体用法:
DequantScaleRoundingModeframework/include/tilefwk/tilefwk_op.h:51OpTypeframework/include/tilefwk/tilefwk_op.h:32OutTypeframework/include/tilefwk/tilefwk_op.h:40ReduceModeframework/include/tilefwk/tilefwk_op.h:413ScatterModeframework/include/tilefwk/tilefwk_op.h:215TransModeframework/include/tilefwk/tilefwk_op.h:461index_addpython/pypto/op/indexing.py:94index_add_ubpython/pypto/op/indexing.py:114一个具体的文档空洞是
docs/zh/api/tensor_api/operation/pypto-index_add.md:45:只让读者参考pypto.index_add_,没有本 API 的可复制片段;相对完整的对照页是pypto-index_add_.md:81-83。在
examples/**/*.py中检索pypto.greater/index_add/sort32/mrgsort/relu/tril/triu均为 0 命中。类型/枚举的“具体示例”也不应只是打印枚举名,而应体现“创建或选择 → 传入实际 API → 校验结果”。关联 Issue
2026-11-05 按
公共 API、无实质文档、API 支持覆盖、核心 API 示例、示例覆盖以及代表性 API 名复查公开 GitCode issue,未发现直接跟踪本单 48/50/41 项覆盖清单且仍未关闭的 issue,暂无需随本单一并关闭的已有条目。检索中出现的单个 API 功能缺陷、参数传递错误或其他文档示例错误,不等同于本次覆盖缺口,不纳入本单的一并关闭范围;关闭前仍应逐项核对其自身问题是否解决。
改进建议
docs/zh/api/index.md增加日志、错误/状态、配置/Tile 类型入口;对SymInt、greater等只有语义提及的 API 补直接用法、参数、返回值和约束。greater/index_add/index_add_ub/sort32/mrgsort等可执行接口;转发型页面也应有本 API 的可复制片段。