mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
The `export_freevars` method was introduced very early on, for propagating writes to unboxed cells from child to parent frame, see https://github.com/pytorch/torchdynamo/commit/d0c10341. However, it's no longer needed after we started to modify root tracer's `symbolic_locals` directly for the unboxed cells, see https://github.com/pytorch/torchdynamo/commit/663e4d92. As a result, we no longer need `export_freevars`. In fact, it can cause a very subtle bug when name collision happens across the parent and child frames during inlining, because the parent frame isn't necessarily the frame that defined the cell captured by child frame. In summary, this patch removes the `export_freevars` bits, and adds a regression test. Pull Request resolved: https://github.com/pytorch/pytorch/pull/140036 Approved by: https://github.com/williamwen42, https://github.com/jansel ghstack dependencies: #140035 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| base.py | ||
| builder.py | ||
| builtin.py | ||
| constant.py | ||
| ctx_manager.py | ||
| dicts.py | ||
| distributed.py | ||
| functions.py | ||
| higher_order_ops.py | ||
| iter.py | ||
| lazy.py | ||
| lists.py | ||
| misc.py | ||
| nn_module.py | ||
| optimizer.py | ||
| script_object.py | ||
| sdpa.py | ||
| tensor.py | ||
| torch_function.py | ||
| torch.py | ||
| user_defined.py | ||