| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
test(jit):add test for ScriptFunction,ScriptFunction.get_debug_state,ScriptFunction.save,and ScriptFunction.save_to_buffer Co-authored-by: fengwu154<1067935138@qq.com> Co-authored-by: fengwu154<wufeng79@h-partners.com> # message auto-generated for no-merge-commit merge: !35409 merge test-torch-jit-ScriptFunction-2.9.0 into v2.9.0 test(jit):add test for ScriptFunction,ScriptFunction.get_debug_state,ScriptFunction.save,and ScriptFunction.save_to_buffer Created-by: fengwu154 Commit-by: fengwu154 Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 https://gitcode.com/Ascend/pytorch/issues/1904 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 1. ** get_debug_state 适配** - 使用 PyTorch 内置的 enable_profiling_mode_for_profiling_tests() 上下文强制启用 profiling executor。 - 执行两次函数(一次 profile,一次 optimize),确保优化计划生成。 - 通过 GRAPH_EXECUTOR 常量判断执行器模式,非 profiling 模式自动跳过测试。 2. **save 适配** - API 签名仅接受字符串路径,因此使用 tempfile.TemporaryDirectory 创建临时文件,避免对文件系统的污染。 3. **save_to_buffer 适配** - 验证返回类型为 bytes,并通过 io.BytesIO 模拟文件流加载,与保存前输出一致。 - **原测试缺口**:test_jit.py 虽大量使用 ScriptFunction,但缺少对其类型、save_to_buffer 及 save 直接路径的专门测试;get_debug_state 仅在特定测试中偶现调用,未系统验证。 - **新增覆盖**: - 类型断言:确保 @torch.jit.script 生成的函数为 torch.jit.ScriptFunction 实例。 - 调试状态:验证在 profiling 模式下两次执行后可获得有效状态对象。 - 序列化闭环:通过 save_to_buffer → load 和 save(file) → load 验证序列化后语义等价。 - **边界适配**:get_debug_state 通过 @unittest.skipIf(GRAPH_EXECUTOR != ProfilingMode.PROFILING, ...) 仅在有 profiling 执行器的环境中运行,避免内部断言错误。 - 新增测试文件 test/jit/test_jit_ScriptFunction.py。 - 实现 4 个测试用例,覆盖 ScriptFunction 类型、调试状态获取、内存序列化与文件序列化。 - 使用条件跳过(@unittest.skipIf)适配不同执行器模式(profiling / simple / legacy)。 - 不依赖外部文件,所有测试可在任意环境运行。 # 【资料变更】 不涉及 # 【接口变更】 不涉及 # 【功能验证】 root@devserver-fae-mirrors:/home/aicc/wf/api/2.7.1/pytorch/test# python test_jit_ScriptFunction.py .... ---------------------------------------------------------------------- Ran 4 tests in 10.120s OK 覆盖版本: v2.7.1 v2.9.0 v2.10.0 v2.11.0 v2.12.0 master # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!35409 | 3 个月前 | |
Adapt test_jit_is_trancing in trace for NPU Co-authored-by: qq_42437014<yandj5@163.com> # message auto-generated for no-merge-commit merge: !36864 merge test-jit-is_tracing-in-trace29 into v2.9.0 Adapt test_jit_is_trancing in trace for NPU Created-by: qq_42437014 Commit-by: qq_42437014 Merged-by: ascend-robot Description: # 【合入来源】 [[Usage]: torch.jit.is_tracing () ----此API,在trace模式下,测试样例缺失](https://gitcode.com/Ascend/pytorch/issues/1706) > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> - [x] issue/工单 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) ## API 功能 torch.jit.istracing 是 TorchScript 核心执行模式判断 API,用于在静态图编译与执行阶段检测当前代码是否处于 tracing 编译上下文,支持在 tracing / scripting 混合编码场景下实现条件分支、执行路径切换、图编译行为适配,保障不同执行模式下代码逻辑的正确性,是 TorchScript 动态适配、图优化、模式感知的基础能力。 ## 测试用例说明 1. scrpit模式下,API torch.jit.is_tracing () PyTorch 官方 test_jit.py(官方路径: pytorch/test/test_jit.py;行号位置:两个测试用例的位置大概在9783-9798行)包含test_script_is_tracing、test_script_get_tracing_state 两个测试用例。 **测试用例详解** • test_script_get_tracing_state:调用底层私有接口判定追踪状态,依托NPU张量运算分支结果,校验底层接口识别追踪模式的有效性。 • test_script_is_tracing:使用官方标准接口判断追踪状态,结合NPU张量执行脚本编译校验,验证公开接口在图追踪场景下判定逻辑正常。 2. trace模式下,API torch.jit.is_tracing () 添加新测试用例test/test_jit_is_tracing_in_trace.py • 基础环境适配:引入torch_npu库启用NPU设备能力,构造NPU张量作为测试输入数据 • 核心功能验证:校验进入JIT轨迹录制流程时,接口可正确返回真值 **测试用例详解** • test_is_tracing_returns_true_in_trace_mode:基于接口返回结果编写分支判断逻辑,使用NPU张量执行轨迹录制。通过最终运算输出结果,确认程序成功走入轨迹模式分支,验证接口状态判定逻辑有效。 **测试用例构造说明** 由于 PyTorch 的 torch.jit.trace 机制限制,在被追踪函数内部执行时,底层的 Python 级追踪标志位(tracing flag)依然保持为 False,因此无法直接在函数内部进行断言验证。本测试转而采用严格的“行为验证”方案:利用 Tracer “仅记录单条执行路径”的特性,通过校验最终的输出结果,反向证明 is_tracing() 成功触发了目标分支,且该计算路径已被正确固化到 TorchScript 图中。 ## NPU 适配说明 1. scrpit模式下,API torch.jit.is_tracing ()适配说明 torch.jit.istracing 为 TorchScript 前端执行模式检测 API,无硬件相关底层算子依赖,NPU 完全兼容 PyTorch 原生实现,功能行为、状态语义、编译逻辑与 CPU 保持一致。此测试样例无需修改,可直接测试验证。 • 基础环境适配:将仓库test_upstream/test/test_jit.py.patch,进行apply之后,已有import torch_npu基础环境的适配; • 张量设备调整:将仓库test_upstream/test/test_jit.py.patch,进行apply之后,代码已将cpu的张量修改为npu上运行。确保异步计算的结果载体(张量)运行在 NPU 上,贴合 NPU 场景使用需求。 2. trace模式下,API torch.jit.is_tracing ()适配说明 新增测试用例:test/test_jit_is_tracing_in_trace.py,补齐NPU设备场景下接口相关测试覆盖。 • 基础环境适配:引入torch_npu库启用NPU设备能力,构造NPU张量作为测试输入数据。 # 【资料变更】 不涉及,已经在 https://gitcode.com/Ascend/pytorch/tree/v2.7.1/docs/zh/native_apis 的文档中进行查找与验证。该目录下的pytorch_2-6-0至pytorch_2-10-0文件夹下的torch-jit.md已经对"torch.jit.is_tracing"全部标注"是 支持fp32"。无需更改 # 【接口变更】 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图 **测试命令:** #script模式下,测试命令 cd pytorch/test python -m unittest test_jit.TestScript.test_script_is_tracing test_jit.TestScript.test_script_get_tracing_state -v #trace模式下,测试命令 cd pytorch/test python test_jit_is_tracing_in_trace.py -v **测试结果:** 1. script模式下,测试结果 root@060bc3e997eb:/workspace/user_data/527/29/pytorch/test# python -m unittest test_jit.TestScript.test_script_is_tracing test_jit.TestScript.test_script_get_tracing_state -v /usr/local/python3.11.14/lib/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:362: ImportWarning: ************************************************************************************************************* The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now.. The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now.. The backend in torch.distributed.init_process_group set to hccl now.. The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now.. The device parameters have been replaced with npu in the function below: torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.load, torch.set_default_device, torch.get_device_module, torch.sparse_compressed_tensor, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.Tensor.pin_memory, torch.nn.Module.to, torch.nn.Module.to_empty ************************************************************************************************************* warnings.warn(msg, ImportWarning) /usr/local/python3.11.14/lib/python3.11/site-packages/torch_npu/contrib/transfer_to_npu.py:291: RuntimeWarning: torch.jit.script and torch.jit.script_method will be disabled by transfer_to_npu, which currently does not support them, if you need to enable them, please do not use transfer_to_npu. warnings.warn(msg, RuntimeWarning) monkeytype is not installed. Skipping tests for Profile-Directed Typing test_script_is_tracing (test_jit.TestScript.test_script_is_tracing) ... ok test_script_get_tracing_state (test_jit.TestScript.test_script_get_tracing_state) ... ok ---------------------------------------------------------------------- Ran 2 tests in 0.167s OK 2. trace模式下,测试结果 root@2bf81948454c:/workspace/user_data/527/29/pytorch/test# python test_jit_is_tracing_in_trace.py -v test_is_tracing_returns_true_in_trace_mode (__main__.TestJitIsTracing.test_is_tracing_returns_true_in_trace_mode) Validates that torch.jit.is_tracing() returns True during trace recording. ... ok ---------------------------------------------------------------------- Ran 1 test in 1.570s OK **验证结论:** NPU 环境运行script/trace模式下的测试用例,三个用例执行成功,无功能失败项。torch.jit.is_tracing 模式检测、状态返回、控制流分支适配等能力均符合 PyTorch 标准语义,适配完成且验证通过 # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [x] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!36864 | 2 个月前 | |
add test for add_module and apply api in torch.jit.ScriptModule Co-authored-by: bobebest<773449114@qq.com> # message auto-generated for no-merge-commit merge: !38690 merge test-2.9.0 into v2.9.0 add test for add_module and apply api in torch.jit.ScriptModule Created-by: bobebest Commit-by: bobebest Merged-by: ascend-robot Description: <!-- PR描述模板更新日期:20260203 --> # 【合入来源】 > <font color="red">**如有社区issue,请关联issue链接**</font>\ > <font color="red">**请勿携带内部流程信息(需求链接、问题单、内部issue等)**</font> https://gitcode.com/Ascend/pytorch/issues/1977 - [ ] 需求 - [ ] 问题单 - [x] issue/工单 - [ ] 重构优化 - [ ] 资料更新 # 【修改方案】 > 请描述修改内容的具体实现,涉及哪些组件之间进行交互,可以用1、2、3、...进行罗列\ > 如果是需求或者重构类的PR,需要补充详细设计文档(说明上下游组件关系、时序图、类图、DFX能力等内容) torch.jit.ScriptModule.add_module和torch.jit.ScriptModule.apply:已在 PyTorch 官方社区搜索 ,无针对该 API 的专门测试用例,因此自行编写测试用例。 Torch.jit.ScriptModule各属性介绍:把一个普通的 Python 模型(nn.Module)编译成 TorchScript 模型(ScriptModule),让它可以脱离 Python、在 NPU/C++/ 推理引擎上跑。 # *API介绍***** **torch.jit.ScriptModule.add_module**是 PyTorch TorchScript 中用于动态添加子模块的核心方法,该子模块可以使用给定的名称作为属性进行访问; **语法**:add_module(name, module) **参数:** name(str):子模块的名称,可以是任意字符串 module(torch.nn.Module 或 None):要添加的子模块实例;传入 None 时相当于删除该名称对应的子模块 **返回值:**None **核心特性:** 1、TorchScript 静态性约束:只有 add_module 能让 TorchScript 识别并追踪新加入的子模块、参数和缓冲区; 2、动态网络构建:适用于运行时才决定网络结构的场景(如循环添加多层、条件分支添加模块); 3、状态管理:加入的子模块会被纳入 parameters()、state_dict()、to(device)、train()/eval() 等管理体系。 **torch.jit.ScriptModule.apply**是 PyTorch TorchScript 静态图模块 的递归遍历函数,递归遍历模块自身 + 所有子模块,对每一个模块执行传入的函数。 **语法:**apply(fn) **参数:** fn(Callable[[torch.nn.Module], None]):一个函数,接受一个 Module 实例作为输入,返回 None。该函数会被递归地应用到模块自身和每一个子模块上 **返回值**:self(即调用 apply 的 ScriptModule 实例本身) **核心特性如下**: 1、递归执行:深度优先遍历所有子模块 2、原地修改:直接修改模块,不返回新模型 3、顺序固定:先处理自身,再处理子模块 4、TorchScript 安全:可在静态图中正常使用 5、生命周期统一管理:参数、设备、模式全部生效 **具体测试内容如下:** | 测试维度 | 具体内容 | |---------|---------| | 功能正确性 | torch.jit.ScriptModule.add_module 能否正确添加子模块;torch.jit.ScriptModule.apply 能否正确修改参数 | | 递归行为 | torch.jit.ScriptModule.apply 是否递归访问所有嵌套子模块 | | 类型一致性 | 添加的子模块是否被转换为 ScriptModule 类型 | | 设备适配 | 所有参数和张量在 NPU 设备上的 device type 是否正确 | | 前向推理 | 修改后的模型能否正常执行前向传播 | | 返回值语义 | torch.jit.ScriptModule.apply 是否返回自身以支持链式调用 | # 【资料变更】 > 请确认是否涉及资料变更。如涉及,需要在PR中体现,并简要说明修改内容。如不涉及,需填写“不涉及” 不涉及 # 【接口变更】 > 请确认是否涉及跨代码仓或者客户面可见的接口变更。如涉及,需要详细说明接口以及对应的变更内容,同时需要在资料中体现。如不涉及,需填写“不涉及” 不涉及 # 【功能验证】 > 说明测试场景,测试方法。如果本次测试方式与常规单元测试不同,请详细说明您的测试步骤\ > 新增/变更内容是否已新增/适配UT测试用例看护,并补充测试自验证截图  # 【CheckList】 > PR提交人对以下CheckList自检项进行全量自检,自检通过或不涉及,均修改 [ ] 为 [x] - [x] 代码注释完备,正确记录错误日志 - [x] 代码实现进行了返回值、空指针等校验 - [x] PR标题正确使用类型标签,如:feat、fix、refactor、docs、test等 - [ ] PR持续集成流水线(CI)执行通过,代码检查无异常 See merge request: Ascend/pytorch!38690 | 1 个月前 | |
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
test(jit): add ScriptModule API alignment test cases [v2.9.0] Co-authored-by: TensorLake<l.wenjie@foxmail.com> # message auto-generated for no-merge-commit merge: !37633 merge test/script-module-npu-v2.9.0 into v2.9.0 test(jit): add ScriptModule API alignment test cases [v2.9.0] Created-by: TensorLake Commit-by: TensorLake Merged-by: ascend-robot Description: ## 【合入来源】 Fork: TensorLake/torch-npu 分支: test/script-module-npu-v2-9-0 → Ascend/pytorch:v2.9.0 ## 【修改方案】 本 PR 为 [#1861](https://gitcode.com/Ascend/pytorch/issues/1861) 的交付。社区用例情况:已在 PyTorch 官方社区 pytorch/test/jit/ 下搜索 ScriptModule 相关测试,无针对这 19 个 API 的独立测试用例,因此自行编写测试用例。 ### 一、API 功能说明及行为分类 torch.jit.ScriptModule 通过 torch.jit.script() 创建,返回 RecursiveScriptModule 实例。其方法可见性由双层机制控制: 1. RecursiveScriptModule 自己定义的方法(如 save()、extra_repr()) 2. _compiled_methods_allowlist 白名单中的 nn.Module 方法(如 train()、to()、state_dict()) 3. 不满足以上两条的方法被 _make_fail 替换,调用即抛 RuntimeError("xxx is not supported on ScriptModules") 本测试使用 torch.jit.script() 作为 canonical 创建方式,正确验证 allowlist 机制的行为。按实测行为将 19 个 API 分为 4 类: **第一类:allowlist 内正常工作(11 个)** | API | 来源 | 行为说明 | |-----|------|---------| | train(mode) | 白名单 | 设置训练模式,返回 self,递归传播到子模块 | | eval() | 白名单 | 等价于 train(False),返回 self | | zero_grad(set_to_none) | 白名单 | 清零所有参数梯度 | | float() | 白名单 | 将参数/buffer 转为 float32,返回 self,递归传播 | | double() | 白名单 | 将参数/buffer 转为 float64。NPU 不支持 float64,自动降级为 float32 | | to(dtype/device) | 白名单 | 支持多参数形式,递归传播 | | type(dst_type) | 白名单 | 转换 dtype | | state_dict(...) | 白名单 | 返回 OrderedDict,支持 prefix=、destination=、keep_vars= 参数 | | save(f, _extra_files) | RSM 自定义 | 委托 C++,无返回值。支持 _extra_files 附加文件 | | save_to_buffer() | RSM 自定义 | 序列化到 bytes 并返回 | | extra_repr() | RSM 自定义 | 返回 "original_name=..." 格式字符串 | **第二类:_make_fail 封杀(5 个,与 CPU/GPU 行为一致)** | API | 异常消息(assertRaisesRegex 匹配) | |-----|-----------------------------------| | requires_grad_() | "requires_grad_ is not supported on ScriptModules" | | to_empty() | "to_empty is not supported on ScriptModules" | | xpu() | "xpu is not supported on ScriptModules" | | get_buffer() | "get_buffer is not supported on ScriptModules" | | set_submodule() | "set_submodule is not supported on ScriptModules" | **第三类:torch-npu 拦截(3 个)** | API | CPU 行为 | NPU 行为 | |-----|---------|---------| | share_memory() | 正常工作 | RuntimeError: "share_memory is not supported in npu" | | register_module() | RuntimeError(PyTorch 限制) | RuntimeError(torch-npu 先拦截) | | register_parameter() | RuntimeError(PyTorch 限制) | RuntimeError(torch-npu 先拦截) | 注:share_memory 在 GPU/CUDA 上为 **no-op**(官方文档明确),NPU 行为与 GPU 不一致。 **第四类:PyTorch 内部未完成实现(1 个)** | API | 行为 | |-----|------| | set_extra_state() | RuntimeError: "should never be called" | ### 二、测试文件说明 新增文件:test/jit/test_script_module.py,共 67 个测试用例,按功能语义分为 10 个测试类: - TestScriptModuleTrainEval(11 个):train/eval 默认状态、显式设置、返回值验证、往返切换、NPU 验证、子模块递归传播 - TestScriptModuleZeroGrad(5 个):无梯度不报错、梯度清零、set_to_none 语义、set_to_none=False 清零、backward→zero_grad→backward 链路 - TestScriptModuleTo(9 个):dtype/device/device+dtype/dtype_keyword/string_device/no_args 多形式、返回值验证、子模块传播 - TestScriptModuleFloatDouble(7 个):float 转换/传播、double 转换/NPU float64 降级 float32/传播 - TestScriptModuleType(4 个):float32 正常路径、float64 降级路径、NPU 验证、int32 异常 - TestScriptModuleStateDict(7 个):参数/buffer 包含、值匹配、NPU 设备验证、prefix/destination/keep_vars 参数形式 - TestScriptModuleSave(6 个):save/load 往返、参数保留、返回 None、NPU 验证、_extra_files、save_to_buffer - TestScriptModuleExtraRepr(3 个):返回字符串、original_name 模式、NPU 验证 - TestScriptModuleShareMemory(4 个):CPU 返回 self/makes_shared/幂等、NPU assertRaisesRegex 拦截 - TestScriptModuleMetadata(7 个):register_module/register_parameter NPU 拦截、set_submodule _make_fail、get_buffer _make_fail - TestScriptModuleUnsupported(4 个):requires_grad_/to_empty/xpu _make_fail、set_extra_state 未完成实现 所有可预测异常的 API 均使用 assertRaisesRegex 精确匹配异常信息内容。 ### 三、NPU 适配说明 - 所有涉及张量的测试均在 NPU 设备上运行 - NPU 不支持 float64,double()/to(torch.float64)/type(torch.float64) 自动降级为 float32 - share_memory 在 NPU 上被拦截(GPU 为 no-op,行为不一致,已在测试中标注) - _make_fail 封杀的 5 个 API 在所有设备上行为一致 ## 【资料变更】 经检查 docs/zh/native_apis/ 下各版本路径,已有记录的 API 18/19。set_submodule 缺失,已通过独立文档 PR 提交。 ## 【接口变更】 不涉及 ## 【功能验证】 测试文件:test/jit/test_script_module.py 测试环境:torch 2.9.0 + torch_npu 2.9.0 + NPU 910B3(CANN 8.5.0) ``` test_extra_repr_contains_original_name (__main__.TestScriptModuleExtraRepr.test_extra_repr_contains_original_name) ... ok test_extra_repr_on_npu (__main__.TestScriptModuleExtraRepr.test_extra_repr_on_npu) ... ok test_extra_repr_returns_str (__main__.TestScriptModuleExtraRepr.test_extra_repr_returns_str) ... ok test_double_converts_params (__main__.TestScriptModuleFloatDouble.test_double_converts_params) ... [W604 11:34:32.815442779 compiler_depend.ts:164] Warning: Device do not support double dtype now, dtype cast replace with float. (function operator()) ok test_double_on_npu_fallback_to_float32 (__main__.TestScriptModuleFloatDouble.test_double_on_npu_fallback_to_float32) ... ok test_double_returns_self (__main__.TestScriptModuleFloatDouble.test_double_returns_self) ... ok test_float_converts_params (__main__.TestScriptModuleFloatDouble.test_float_converts_params) ... ok test_float_on_npu (__main__.TestScriptModuleFloatDouble.test_float_on_npu) ... ok test_float_propagates_to_submodules (__main__.TestScriptModuleFloatDouble.test_float_propagates_to_submodules) ... ok test_float_returns_self (__main__.TestScriptModuleFloatDouble.test_float_returns_self) ... ok test_get_buffer_unsupported (__main__.TestScriptModuleMetadata.test_get_buffer_unsupported) ... ok test_get_buffer_unsupported_nonexistent (__main__.TestScriptModuleMetadata.test_get_buffer_unsupported_nonexistent) ... ok test_get_buffer_unsupported_on_nested (__main__.TestScriptModuleMetadata.test_get_buffer_unsupported_on_nested) ... ok test_register_module_raises_on_npu (__main__.TestScriptModuleMetadata.test_register_module_raises_on_npu) ... ok test_register_parameter_raises_on_npu (__main__.TestScriptModuleMetadata.test_register_parameter_raises_on_npu) ... ok test_set_submodule_nested_raises (__main__.TestScriptModuleMetadata.test_set_submodule_nested_raises) ... ok test_set_submodule_raises (__main__.TestScriptModuleMetadata.test_set_submodule_raises) ... ok test_save_and_load (__main__.TestScriptModuleSave.test_save_and_load) ... ok test_save_on_npu (__main__.TestScriptModuleSave.test_save_on_npu) ... ok test_save_preserves_output (__main__.TestScriptModuleSave.test_save_preserves_output) ... ok test_save_returns_none (__main__.TestScriptModuleSave.test_save_returns_none) ... ok test_save_to_buffer (__main__.TestScriptModuleSave.test_save_to_buffer) ... ok test_save_with_extra_files (__main__.TestScriptModuleSave.test_save_with_extra_files) ... ok test_share_memory_cpu_idempotent (__main__.TestScriptModuleShareMemory.test_share_memory_cpu_idempotent) ... ok test_share_memory_cpu_makes_shared (__main__.TestScriptModuleShareMemory.test_share_memory_cpu_makes_shared) ... ok test_share_memory_cpu_returns_self (__main__.TestScriptModuleShareMemory.test_share_memory_cpu_returns_self) ... ok test_share_memory_on_npu_raises (__main__.TestScriptModuleShareMemory.test_share_memory_on_npu_raises) ... ok test_state_dict_contains_buffers (__main__.TestScriptModuleStateDict.test_state_dict_contains_buffers) ... ok test_state_dict_contains_params (__main__.TestScriptModuleStateDict.test_state_dict_contains_params) ... ok test_state_dict_keep_vars (__main__.TestScriptModuleStateDict.test_state_dict_keep_vars) ... ok test_state_dict_on_npu (__main__.TestScriptModuleStateDict.test_state_dict_on_npu) ... ok test_state_dict_values_match (__main__.TestScriptModuleStateDict.test_state_dict_values_match) ... ok test_state_dict_with_destination (__main__.TestScriptModuleStateDict.test_state_dict_with_destination) ... ok test_state_dict_with_prefix (__main__.TestScriptModuleStateDict.test_state_dict_with_prefix) ... ok test_to_device (__main__.TestScriptModuleTo.test_to_device) ... ok test_to_device_and_dtype (__main__.TestScriptModuleTo.test_to_device_and_dtype) ... ok test_to_dtype (__main__.TestScriptModuleTo.test_to_dtype) ... ok test_to_dtype_keyword (__main__.TestScriptModuleTo.test_to_dtype_keyword) ... ok test_to_no_args_returns_self (__main__.TestScriptModuleTo.test_to_no_args_returns_self) ... ok test_to_npu_and_dtype (__main__.TestScriptModuleTo.test_to_npu_and_dtype) ... ok test_to_propagates_to_submodules (__main__.TestScriptModuleTo.test_to_propagates_to_submodules) ... ok test_to_returns_self (__main__.TestScriptModuleTo.test_to_returns_self) ... ok test_to_string_device (__main__.TestScriptModuleTo.test_to_string_device) ... ok test_eval_on_npu (__main__.TestScriptModuleTrainEval.test_eval_on_npu) ... ok test_eval_propagates_to_submodules (__main__.TestScriptModuleTrainEval.test_eval_propagates_to_submodules) ... ok test_eval_returns_self (__main__.TestScriptModuleTrainEval.test_eval_returns_self) ... ok test_eval_sets_training_false (__main__.TestScriptModuleTrainEval.test_eval_sets_training_false) ... ok test_train_default_is_training (__main__.TestScriptModuleTrainEval.test_train_default_is_training) ... ok test_train_eval_roundtrip (__main__.TestScriptModuleTrainEval.test_train_eval_roundtrip) ... ok test_train_on_npu (__main__.TestScriptModuleTrainEval.test_train_on_npu) ... ok test_train_propagates_to_submodules (__main__.TestScriptModuleTrainEval.test_train_propagates_to_submodules) ... ok test_train_returns_self (__main__.TestScriptModuleTrainEval.test_train_returns_self) ... ok test_train_set_false (__main__.TestScriptModuleTrainEval.test_train_set_false) ... ok test_train_set_true_explicit (__main__.TestScriptModuleTrainEval.test_train_set_true_explicit) ... ok test_type_float32 (__main__.TestScriptModuleType.test_type_float32) ... ok test_type_float64 (__main__.TestScriptModuleType.test_type_float64) ... ok test_type_int32_raises (__main__.TestScriptModuleType.test_type_int32_raises) ... ok test_type_on_npu (__main__.TestScriptModuleType.test_type_on_npu) ... ok test_requires_grad_unsupported (__main__.TestScriptModuleUnsupported.test_requires_grad_unsupported) ... ok test_set_extra_state_raises (__main__.TestScriptModuleUnsupported.test_set_extra_state_raises) ... ok test_to_emp See merge request: Ascend/pytorch!37633 | 2 个月前 | |
| 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 个月前 | ||
| 2 个月前 | ||
| 1 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 个月前 | ||
| 2 年前 |