pytorch
d8e795ec - [modes] make python arg parser also check for python key (#91573)

Commit
2 years ago
[modes] make python arg parser also check for python key (#91573) Fixes #90652 Previously, we had assumed that the only way to call `handle_torch_function_no_python_arg_parser` was through the Python key. This is no longer true with FakeTensor. Specifically `_like` functions will call `.device()` on FakeTensors when the args list is being parsed. In order to respect that the mode stack shouldn't run when the python key is off, this just adds that a check that the python key is on/the torch_function equivalent to that function Pull Request resolved: https://github.com/pytorch/pytorch/pull/91573 Approved by: https://github.com/ezyang
Author
samdow
Committer
Parents
Loading