mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
closes #35643 This PR is mostly borrowed from #82042. Thanks @Padarn for implementing the first version and debugging into the errors. Based on the discussion in #82042 this PR adds a with_kwargs argument to register_forward_pre_hook and register_forward_hook methods. When the arg is set to true, the provided hook must accept kwargs args. Under the hook, this PR adds a `_forward_pre_hooks_with_kwargs` and a `_forward_hook_with_kwargs` set to keep track of which hooks accept kwargs. Differential Revision: [D41431111](https://our.internmc.facebook.com/intern/diff/D41431111) Pull Request resolved: https://github.com/pytorch/pytorch/pull/89389 Approved by: https://github.com/soulitzer |
||
|---|---|---|
| .. | ||
| backends | ||
| intrinsic | ||
| modules | ||
| parallel | ||
| qat | ||
| quantizable | ||
| quantized | ||
| utils | ||
| __init__.py | ||
| _reduction.py | ||
| common_types.py | ||
| cpp.py | ||
| functional.py | ||
| functional.pyi.in | ||
| grad.py | ||
| init.py | ||
| parameter.py | ||
| parameter.pyi | ||