已开启
test(dynamo): cover assume_constant_result on NPU #42035
2501_93637465创建于 7月18日
test(dynamo): cover assume_constant_result on NPU #42035
已开启
共 1 个文件变更+13-5
| @@ -1,11 +1,19 @@ | |||
| 1 | diff --git a/test/dynamo/test_decorators.py b/test/dynamo/test_decorators.py | 1 | diff --git a/test/dynamo/test_decorators.py b/test/dynamo/test_decorators.py |
| 2 | -index 6842345..b39a435 100644 | 2 | +index 6842345..6c51b74 100644 |
| 3 | --- a/test/dynamo/test_decorators.py | 3 | --- a/test/dynamo/test_decorators.py |
| 4 | +++ b/test/dynamo/test_decorators.py | 4 | +++ b/test/dynamo/test_decorators.py |
| 5 | -@@ -1,3 +1,6 @@ | 5 | +@@ -0,0 +1,3 @@ |
| 6 | +import torch_npu | 6 | +import torch_npu |
| 7 | +from torch_npu.contrib import transfer_to_npu | 7 | +from torch_npu.contrib import transfer_to_npu |
| 8 | + | 8 | + |
| 9 | - # Owner(s): ["module: dynamo"] | 9 | +@@ -1155 +1158 @@ If the above doesn't work, please subtmit an issue to GitHub. |
| 10 | - import functools | 10 | +- return torch.full([n], s) |
| 11 | - import operator | 11 | ++ return torch.full([n], s).npu() |
| 12 | +@@ -1164 +1167 @@ If the above doesn't work, please subtmit an issue to GitHub. | ||
| 13 | +- B = torch.tensor(B_list, dtype=torch.int32) | ||
| 14 | ++ B = torch.tensor(B_list, dtype=torch.int32).npu() | ||
| 15 | + If the above doesn't work, please subtmit an issue to GitHub. | ||
| 16 | +- y = torch.tensor([1]) | ||
| 17 | +- x = torch.tensor(1) | ||
| 18 | ++ y = torch.tensor([1]).npu() | ||
| 19 | ++ x = torch.tensor(1).npu() | ||