mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
We can auto-functionalize operators that mutate their inputs as long as the outputs of the operator do not alias their inputs. The user needs to provide an abstract impl for the operator if it has non-trivial returns. - We update can_auto_functionalize(op) to include ops that return (but do not alias) Tensors - We update auto_functionalized(op, mutated_args_names, kwargs) to return (out, mutated_args), where `out = op(**kwargs)` and `mutated_args` are the new values of the inputs that would have been mutated. Test Plan: - new test Pull Request resolved: https://github.com/pytorch/pytorch/pull/115135 Approved by: https://github.com/bdhirsh ghstack dependencies: #114955, #114956, #115134 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| fake_tensor.py | ||
| fake_utils.py | ||
| functional_tensor.py | ||
| meta_utils.py | ||
| schema_check_mode.py | ||