File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1730,7 +1730,7 @@ def f1_replaced(x):
1730
1730
self .assertEqual (f1_out , f1_replaced_out )
1731
1731
self .assertEqual (count , 1 )
1732
1732
1733
- # Case 2: mutates graph input
1733
+ # Case 2: mutates graph input (not supported yet)
1734
1734
@torch .compile (fullgraph = True , backend = custom_backend )
1735
1735
def f2 (x ):
1736
1736
out = torch .zeros_like (x )
@@ -1747,9 +1747,8 @@ def f2_replaced(x):
1747
1747
f2_replaced_inp = inp .clone ().detach ()
1748
1748
f2_out = f2 (f2_inp )
1749
1749
f2_replaced_out = f2_replaced (f2_replaced_inp )
1750
- self .assertEqual (f2_inp , f2_replaced_inp )
1751
- self .assertEqual (f2_out , f2_replaced_out )
1752
- self .assertEqual (count , 1 )
1750
+ with self .assertRaisesRegex (AssertionError , "Pattern matcher does not yet support mutable ops that mutate graph input" ):
1751
+ self .assertEqual (f2_out , f2_replaced_out )
1753
1752
1754
1753
if __name__ == "__main__" :
1755
1754
if IS_LINUX and HAS_GPU :
You can’t perform that action at this time.
0 commit comments