已关闭
docs:The test case coverage for the torch.UntypedStorage.to API is incomplete; additional test cases and docs need to be added. #44657
Wo150创建于 23 天前关闭于 1 天前
docs:The test case coverage for the torch.UntypedStorage.to API is incomplete; additional test cases and docs need to be added. #44657
已关闭
当前Pull Request已关闭, 关闭人@Wo150
atomgit-bot
23 天前 评论:
23 天前 评论:
变更摘要
本 PR 主要为 torch.UntypedStorage.to API 补充 NPU 场景下的测试覆盖,新增测试文件 test/npu/test_untyped_storage_to.py,围绕存储在不同设备(NPU/CPU)间的转移行为进行验证,包括目标设备表示方式、阻塞与非阻塞转移选项、同设备返回自身、空存储转移、跨 NPU 设备复制以及非法参数等场景,合计改动 4 个文件、新增 64 行。
主要改动
- 新增测试文件
test/npu/test_untyped_storage_to.py:为torch.UntypedStorage.toAPI 在 NPU 上的行为补充系统化测试用例。 - 新增
test_to_npu_device_types用例:覆盖使用设备类型字符串与torch.device等目标设备表示方式将存储转移到当前 NPU 的场景,验证返回类型、目标设备与存储内容。 - 新增阻塞/非阻塞转移用例
test_to_npu_non_blocking_options与test_to_cpu_non_blocking_options:覆盖固定内存到 NPU 以及 NPU 到 CPU 的转移,并验证non_blocking为None、False、True时的目标设备、内容一致性及非固定内存状态。 - 新增设备转移边界用例
test_to_same_npu_returns_self、test_to_empty_storage与test_to_another_npu:分别验证同设备转移返回原对象自身、空存储转移后字节数为零且目标设备正确、以及多加速器可用时的跨 NPU 复制(设备不足时跳过)。 - 新增
test_to_invalid_arguments用例:覆盖空设备、列表设备及无效参数等异常入参场景。


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


此处折叠了82条消息 查看更多
4 天前 添加了label:docs-ci-pipeline-running
ascend-robot
4 天前 评论:
4 天前 评论:
4 天前 删除了label:docs-ci-pipeline-running
4 天前 添加了label:docs-ci-pipeline-success
【合入来源】
issue链接地址:
https://gitcode.com/Ascend/pytorch/issues/4041
https://gitcode.com/Ascend/pytorch/issues/4049
【修改方案】
torch.UntypedStorage.to 这个API在master分支下的docs\zh\api\native_api路径下各版本都缺失资料,需要补齐。
torch.UntypedStorage.untyped 这个API在master分支下的docs\zh\api\native_api路径下各版本都有文档记录,但是针对A5服务器的支持情况有误,需要将不支持A5改为支持。
【资料变更】
结论:涉及。
torch.UntypedStorage.to 这个API在master分支下的docs\zh\api\native_api路径下各版本都缺失资料,需要补齐。
torch.UntypedStorage.untyped 这个API在master分支下的docs\zh\api\native_api路径下各版本都有文档记录,但是针对A5服务器的支持情况有误,需要将不支持A5改为支持。
【接口变更】
结论:不涉及。
当前PR只补充API对应的文档信息,不涉及接口调整。
【功能验证】
当前PR只补充文档信息,不涉及功能验证。
具体的功能验证信息记录在对应的Issue文档内。
【CheckList】