File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -7129,6 +7129,24 @@ def fn(x):
7129
7129
0 , sys .monitoring .events .PY_START , old_callback
7130
7130
)
7131
7131
7132
+ def test_312_local_cell_overlap (self ):
7133
+ keys = range (10 )
7134
+ allowed = [0 , 1 , 2 , 3 ]
7135
+
7136
+ def fn (x ):
7137
+ x = x + 1
7138
+ torch ._dynamo .graph_break ()
7139
+ key = [key for key in keys if key in allowed ]
7140
+
7141
+ def inner ():
7142
+ nonlocal key
7143
+
7144
+ return x + key [0 ]
7145
+
7146
+ self .assertEqual (
7147
+ fn (torch .ones (3 )), torch .compile (fn , backend = "eager" )(torch .ones (3 ))
7148
+ )
7149
+
7132
7150
def test_unbind_copy_out (self ):
7133
7151
def f (eye , out ):
7134
7152
torch .unbind_copy (eye , out = out )
Original file line number Diff line number Diff line change @@ -369,11 +369,7 @@ def update(
369
369
code_options ["co_varnames" ] = tuple (
370
370
args
371
371
+ [v for v in argnames_null if v not in args ]
372
- + [
373
- v
374
- for v in code_options ["co_varnames" ]
375
- if v not in args and v not in freevars
376
- ]
372
+ + [v for v in code_options ["co_varnames" ] if v not in args ]
377
373
+ [IS_TRACING_RESUME_PROLOGUE_VARNAME ]
378
374
)
379
375
code_options ["co_flags" ] = code_options ["co_flags" ] & ~ (
You can’t perform that action at this time.
0 commit comments