当前Pull Request已关闭, 关闭人@Zky0803
变更摘要
本 PR 为纯资料更新类改动(标题以 docs 开头),目标是为 PyTorch 序列化模块中的 torch.serialization.default_restore_location 接口补充文档说明。根据 PR 统计,改动共涉及 4 个文件、新增 68 行、无删除行,属于文档内容新增,不涉及功能代码、接口或配置的变更。任务中未内嵌具体文件的补丁内容,因此以下说明仅基于 PR 标题、描述与文件统计信息。
主要改动
- 新增
torch.serialization.default_restore_location文档: 依据 PR 标题,本次改动为该接口补充使用说明,属于资料更新(docs类型),不涉及任何功能逻辑变更。 - 纯新增、无删除的文档变更: 改动统计为新增 68 行、删除 0 行,说明全部为增量文档内容,不影响现有代码行为。


🤖 本次改动均为数据 / 生成 / 二进制文件(如测试用例、锁文件、媒体资源),没有可审查的代码逻辑,已跳过 AI 代码审查。


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.
PR Approval Progress
⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| **/*.md | ❌ (0/2)(You can also ask: huangjingwei, molly123321, lyx324521, zhenyu10, zichun_ye) | ❌ (0/1)(You can also ask: huangjingwei, zhenyu10, renyujin, wjlflyer, chenrayray) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Zky0803, thanks for your pull request. All authors of the commits have signed the CLA. 👍


当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.7.1-26.1.0 | ||
| v2.9.0 | ||
| v2.11.0-26.1.0 | ||
| v2.12.0-26.1.0 | ||
| v2.7.1 | ||
| v2.11.0 | ||
| v2.10.0 | ||
| v2.9.0-26.1.0 | ||
| v2.12.0 | ||
| v2.10.0-26.1.0 | ||
| ci-test |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


Linking Issue Notice
@Zky0803 , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🛑 | >>> |
| Build_ARM | 🛑 | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| patch_test | 🛑 | >>> | |
| Build_X86_213 | 🛑 | >>> | |
| Build_ARM_213 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | codecheck_pre-commit | ✅ | >>> |
| check_error | ✅ | >>> | |
| lintrunner | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_ARM_A3_Part_01 | 🛑 | >>> |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01_213 | 🛑 | >>> | |
| UT_ARM_A2_Part_02_213 | 🛑 | >>> | |
| UT_ARM_A2_Part_03_213 | 🛑 | >>> | |
| UT_inductor_Part_01_213 | 🛑 | >>> | |
| UT_inductor_Part_02_213 | 🛑 | >>> | |
| UT_inductor_Part_03_213 | 🛑 | >>> | |
| UT_inductor_Part_04_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04_213 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01_213 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_02_213 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


| 阶段 | 任务名 | 状态 | 详情 |
|---|---|---|---|
| 编译构建 | Build_X86 | 🛑 | >>> |
| Build_ARM | 🛑 | >>> | |
| Build_X86_torchair | 🛑 | >>> | |
| Build_ARM_torchair | 🛑 | >>> | |
| patch_test | 🛑 | >>> | |
| Build_X86_213 | 🛑 | >>> | |
| Build_ARM_213 | 🛑 | >>> | |
| 恶意代码检查 | Antipoison | ✅ | >>> |
| 编码安全与规范检查 | codecheck_pre-commit | ✅ | >>> |
| check_error | ✅ | >>> | |
| lintrunner | ✅ | >>> | |
| 开源片段检查 | SCA | ✅ | >>> |
| 开发者测试 | UT_ARM_A3_Part_01 | 🛑 | >>> |
| UT_ARM_A3_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_01 | 🛑 | >>> | |
| UT_inductor_Part_02 | 🛑 | >>> | |
| UT_inductor_Part_03 | 🛑 | >>> | |
| UT_inductor_Part_04 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_02 | 🛑 | >>> | |
| UT_ARM_A2_Part_01_213 | 🛑 | >>> | |
| UT_ARM_A2_Part_02_213 | 🛑 | >>> | |
| UT_ARM_A2_Part_03_213 | 🛑 | >>> | |
| UT_inductor_Part_01_213 | 🛑 | >>> | |
| UT_inductor_Part_02_213 | 🛑 | >>> | |
| UT_inductor_Part_03_213 | 🛑 | >>> | |
| UT_inductor_Part_04_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_01_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_02_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_03_213 | 🛑 | >>> | |
| UT_DIST_ARM_Part_04_213 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_01_213 | 🛑 | >>> | |
| UT_ARM_A2_Select_Part_02_213 | 🛑 | >>> | |
| 流水线 | PR-pipeline_pytorch | ✅ | >>> |
- compile、compile_inductor、compile_torchair : 运行流水线
- retry : 重试流水线所有失败子任务
- retry <任务名> : 仅重试指定失败子任务
- stop : 停止流水线


@ascend-robot 本 PR 为 docs 资料变更,docs CI 未自动触发(对比同批次资料 PR #45079/#45083 均可自动触发),请协助调度 docs 流水线,谢谢。


当前仓库存在以下 保护分支 :
| Protected Branch | Version | Release |
|---|---|---|
| master | ||
| v2.7.1 | ||
| v2.10.0-26.1.0 | ||
| v2.9.0-26.1.0 | ||
| v2.10.0 | ||
| v2.7.1-26.1.0 | ||
| v2.9.0 | ||
| v2.11.0-26.1.0 | ||
| v2.12.0-26.1.0 | ||
| v2.11.0 | ||
| v2.12.0 | ||
| ci-test |
评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作
注意:
- /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
- 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭


【合入来源】
任务来源:【社区任务】7月社区任务第四期-Ascend for PyTorch API 一致性开发(61)
结果记录:torch.serialization.default_restore_location 补齐结果
资料 PR:PR #45113
【分支范围】
本资料 PR 面向
master目标分支。当前
master/docs/zh/api/native_api资料体系包含:pytorch_2-9-0、pytorch_2-10-0已不在当前 Native API 资料目录中,本 PR 不涉及这两个版本。
资料分支:
本 PR 为 docs-only 单提交,未包含测试代码或功能代码修改。
【修改方案】
补充公开 API:
的 Native API 支持资料。
四套资料原有
Serialization章节均已包含:但补齐前均未登记:
因此本 PR 在各版本
torch.md的torch.load之后、## Parallelism之前增加目标 API 条目。
修改文件:
新增结构:
各版本分别链接对应 PyTorch 2.7、2.11、2.12、2.13 的原生文档页面。
【支持情况】
支持状态与各版本现有
torch.loadSerialization 条目保持一致:torch.serialization.default_restore_location为序列化位置恢复/调度类 API,不属于 Tensor 数值计算接口,因此本 PR 不增加 fp16、fp32、bf16 等数据类型限制说明。
新增支持状态使用当前资料规范的
✔ / ✘形式。【社区用例与代码 PR 说明】
PyTorch 社区已有
torch.load(..., map_location=...)的间接覆盖,但未发现直接调用:并验证 NPU restore 行为的目标测试。
根据当前任务分类,代码侧在 Torch-NPU 已有测试文件:
中补充直接 NPU 测试,代码 PR 分别面向:
当前官方仓库未提供
v2.13.0代码目标分支,因此不创建第五个 v2.13.0 代码 PR;但
pytorch_2-13-0Native API 资料目录已存在,因此本资料 PR 同步维护 2.13.0 资料。本资料 PR 不依赖
test_upstreampatch。【接口变更】
不涉及。
本 PR 只更新 Native API 支持资料,不修改:
torch.serialization.default_restore_locationPython 实现;test_upstreampatch。【功能验证】
本 PR 为资料变更,已完成资料结构、修改范围和 Git diff 静态验证。
提交与远端验证:
目标 API 在四套资料中的位置:
【test_upstream patch】
不涉及。
本资料 PR 不修改 PyTorch 官方测试文件,也不新增或修改 Torch-NPU
test_upstreampatch。【流程规范说明】
本任务按当前 API 一致性要求独立维护各目标代码分支,并将资料补齐统一提交到
master的独立 docs PR。不使用同步创建其他版本 PR 的
/sync流程。【CheckList】