mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
There has been a series of attempts to provide support for resizing in torch operators like `torch.sigmoid(x, out=y)`, i.e., `y` would have a different shape before and after this expression. Prior to this patch, we have some checks to graph break if the shape changed. This patch extends 1. extends the existing check and graph break for any shape change, not just for `TensorVariable` with source field. 2. removes an old code path which was introduced to address the shape change, but became obselete in that regard because we added extra checks to graph break upon shape change. Moreover, this old code path is unsound, it tries to replace references to the old `TensorVariable` the new one returned by `wrap_fx_proxy`, but it only does the replacement in `symbolic_locals`, which breaks when cells are involved. In general the old `TensorVariable` could be _anywhere_, think the `replace_all` we had for immutable VTs. Pull Request resolved: https://github.com/pytorch/pytorch/pull/140202 Approved by: https://github.com/jansel ghstack dependencies: #140035, #140036, #140149, #140150, #140151, #140201 |
||
|---|---|---|
| .. | ||
| __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 | ||