File tree Expand file tree Collapse file tree 2 files changed +1
-24
lines changed
torchdynamo/optimizations Expand file tree Collapse file tree 2 files changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -60,23 +60,6 @@ def fn(param, y):
60
60
aot_fn (x , y )
61
61
self .assertTrue (not is_safe [0 ])
62
62
63
- def test_new (self ):
64
- # https://github.com/pytorch/torchdynamo/issues/1448
65
- def fn (argsort : torch .Tensor ):
66
- new = argsort .new (2 , 12 , 4096 )
67
- x = torch .add (new , 2 )
68
- return (
69
- new ,
70
- x ,
71
- )
72
-
73
- x = torch .randn ((2 , 12 , 4096 ))
74
- is_safe = [True ]
75
- compiler_fn = functools .partial (compiler_safe_fn , is_safe = is_safe )
76
- aot_fn = torchdynamo .optimize (compiler_fn )(fn )
77
- aot_fn (x )
78
- self .assertTrue (not is_safe [0 ])
79
-
80
63
def test_negative_testing (self ):
81
64
def fn (x , y ):
82
65
return torch .sin (x ).add_ (y )
Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ def is_aot_autograd_safe_to_run(gm, example_inputs):
33
33
Issues
34
34
1) LSTM - https://github.com/pytorch/torchdynamo/issues/1147
35
35
2) LSTM - https://github.com/pytorch/functorch/issues/586
36
- 3) New op - https://github.com/pytorch/torchdynamo/issues/1448
37
- 4) Input mutation - https://github.com/pytorch/torchdynamo/issues/1301
36
+ 3) Input mutation - https://github.com/pytorch/torchdynamo/issues/1301
38
37
"""
39
38
40
39
def raise_or_warn (reason ):
@@ -52,11 +51,6 @@ def raise_or_warn(reason):
52
51
if submod .__class__ .__name__ == "LSTM" :
53
52
return raise_or_warn ("LSTM" )
54
53
55
- # 2) new does not work with fake tensor and aot autograd
56
- for node in gm .graph .nodes :
57
- if node .op == "call_method" and node .target == "new" :
58
- return raise_or_warn ("new operator" )
59
-
60
54
# 2) Mutation in the graph
61
55
mutated = False
62
56
try :
You can’t perform that action at this time.
0 commit comments