Closed
test(export): add NPU adaptation for torch.compiler.is_exporting testcase #42199
makun-2026Add on Jul 20Closed at Aug 17
test(export): add NPU adaptation for torch.compiler.is_exporting testcase #42199
Closed
Total: 1 files changed+12-1
| @@ -1,5 +1,5 @@ | |||
| 1 | diff --git a/test/export/test_export.py b/test/export/test_export.py | 1 | diff --git a/test/export/test_export.py b/test/export/test_export.py |
| 2 | -index 7b51cda..145598c 100755 | 2 | +index 7b51cda..8087754 100755 |
| 3 | --- a/test/export/test_export.py | 3 | --- a/test/export/test_export.py |
| 4 | +++ b/test/export/test_export.py | 4 | +++ b/test/export/test_export.py |
| 5 | @@ -23,6 +23,7 @@ from typing import Dict, List, Union | 5 | @@ -23,6 +23,7 @@ from typing import Dict, List, Union |
| @@ -10,3 +10,14 @@ index 7b51cda..145598c 100755 | |||
| 10 | import torch._dynamo as torchdynamo | 10 | import torch._dynamo as torchdynamo |
| 11 | import torch.fx.traceback as fx_traceback | 11 | import torch.fx.traceback as fx_traceback |
| 12 | import torch.nn.functional as F | 12 | import torch.nn.functional as F |
| 13 | +@@ -4451,8 +4452,8 @@ def forward(self, p_linear_weight, p_linear_bias, x): | ||
| 14 | + ep = export( | ||
| 15 | + Mod(), | ||
| 16 | + ( | ||
| 17 | +- torch.tensor(False), | ||
| 18 | +- torch.randn(3, 4), | ||
| 19 | ++ torch.tensor(False).npu(), | ||
| 20 | ++ torch.randn(3, 4).npu(), | ||
| 21 | + ), | ||
| 22 | + ) | ||
| 23 | + FileCheck().check_count("torch.ops.aten.sin", 1, exactly=True).run( | ||