已关闭
[Usage]: test目录下面的test_models.py继承自pytorch社区,但是里面并没有专门验证torch.nn.Module,torch.nn.Module.state_dict,torch.nn.ModuleDict,torch.nn.ModuleList的测试用例,需要补充 #1575
dinglaiping创建于 3月13日关闭于 3月19日
3月13日 添加了label:usage
3月13日 修改了issue 的描述
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
Ddinglaiping
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
3月13日 关联了pull request:test(nn): add test for models api:torch.nn.Module, torch.nn.Module.state_dict, torch.nn.ModuleDict, torch.nn.ModuleList
huangyunlong
3月18日 评论:
3月18日 评论:
3月19日 关闭了 issue
3月19日 添加了label:resolved
4月10日 添加了label:event: api-consistency


在提交新问题之前,请确保您已经在社区中搜索过相关问题,并使用了社区中提供的资源/工具后,仍未找到满意的解决方式。
环境信息
API功能
1.1.1 torch.nn.Module
PyTorch 所有神经网络模块的基类,所有网络层、模型均继承该类实现:
1.1.2 torch.nn.Module.state_dict
模块状态管理核心方法,用于提取模块及子模块的状态键值对字典:
1.1.3 torch.nn.ModuleDict
键值对型子模块容器,以字符串为索引管理子模块:
1.1.4 torch.nn.ModuleList
有序型子模块容器,以数字为索引管理子模块:
社区用例现状
torch-npu 官方社区的test_models.py通用测试用例,不包含这4个API测试的:torch.nn.Module(基础模块类),torch.nn.Module.state_dict(状态字典方法),torch.nn.ModuleDict(模块字典容器),torch.nn.ModuleList(模块列表容器)。官网测试文件测试的是:通过@modules(module_db)装饰器参数化测试 module_db中定义的神经网络层(如Conv2d、Linear、ReLU等),测试内容包括:test_forward - 前向传播,test_factory_kwargs - 工厂参数,test_pickle - 序列化/反序列化,test_grad / test_gradgrad - 梯度检查test_cpu_gpu_parity - CPU/GPU结果一致性。
欢迎加入社区,感谢您对社区的贡献 🎉!