pytorch/test/cpp
soulitzer 516f3198d6 Fix retains grad behavior after in-place (#79996)
See this doc: https://docs.google.com/document/d/1KiRdnoj6B4cI3yl017hTbCqcOGO1gWIpUf20sldipHM/edit#

Two issues (1) regarding hooks in general and (2) regarding retains grad hooks are fixed, Python hooks, which rely on a different mechanism are not discussed here:
- Hooks in cpp in general
  - (fixed) new hooks to registered to a newer version of the tensor no longer get applied to grad_fn
    associated with older version of the tensor when the first hook was ever registered
  - (unchanged) hooks registered to the older version of the tensor remain active on
- Retains grad hooks
  - (fixed) now get moved to the latest grad_fn. NB: To the user, retains_grad is not considered hooks
    or expected to behave like hooks (which we consider properties of the grad_fn) vs retains_gradness
    which is a property of the tensor.
- (not in this PR) Python hooks
  - (will fix) same issue as hooks in cpp where new hooks are being applied to grad_fn associated
    with the older version of the tensor
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79996
Approved by: https://github.com/albanD
2022-07-08 19:13:28 +00:00
..
api Fix retains grad behavior after in-place (#79996) 2022-07-08 19:13:28 +00:00
c10d Build example_allreduce only for GLOO (#81062) 2022-07-08 02:25:54 +00:00
common
dist_autograd [lint] autoformat test/cpp and torch/csrc 2022-06-11 21:11:16 +00:00
jit Back out "[profiling] Adding targets file for test_mobile_profiler" (#80789) 2022-07-05 23:34:15 +00:00
lazy reinstate size and shape returning symints (#79560) 2022-07-08 01:17:33 +00:00
lite_interpreter_runtime Back out "[profiling] Adding targets file for test_mobile_profiler" (#80789) 2022-07-05 23:34:15 +00:00
monitor torch/monitor: merge Interval and FixedCount stats (#72009) 2022-01-30 23:21:59 +00:00
profiler [lint] autoformat test/cpp and torch/csrc 2022-06-11 21:11:16 +00:00
rpc [lint] autoformat test/cpp and torch/csrc 2022-06-11 21:11:16 +00:00
tensorexpr [BE] Use CamelCase for enum class members (#79772) 2022-06-17 05:53:57 +00:00
__init__.py