pytorch/torch/_C
Richard Zou 5aa183d2bc Add mechanism to disable the "saved tensors hooks" feature (#85553)
The rationale for this is that functorch doesn't work with saved
variable hooks at the moment or checkpointing and we need some way to
disable it.

Concretely:
- there's a context manager that does the disabling
- this feature is disabled on a thread-local basis
- one can set an error message or use the default error message that
says the feature has been disabled

Since it is thread local I needed to update ATen/ThreadLocalState. To
make things nicer, this PR refactors all the "saved tensors hooks"
related TLS things into a single struct.

Test Plan:
- new test
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85553
Approved by: https://github.com/soulitzer
2022-09-28 22:49:28 +00:00
..
__init__.pyi.in [ONNX] Create GraphContext and load g.op method to the class (#84728) 2022-09-28 22:21:55 +00:00
_autograd.pyi Add mechanism to disable the "saved tensors hooks" feature (#85553) 2022-09-28 22:49:28 +00:00
_cudnn.pyi
_distributed_autograd.pyi
_distributed_c10d.pyi Add underlying_store property for PrefixStore (#84640) 2022-09-07 23:02:47 +00:00
_distributed_rpc_testing.pyi Remove ProcessGroup from TensorPipeAgent initialization (#68128) 2021-11-11 12:28:55 -08:00
_distributed_rpc.pyi Fix use-dict-literal lint (#83718) 2022-08-24 00:26:46 +00:00
_functions.pyi
_functorch.pyi Delete functorch's monkeypatching (#85430) 2022-09-22 18:47:12 +00:00
_itt.pyi Enable Intel® VTune™ Profiler's Instrumentation and Tracing Technology APIs (ITT) to PyTorch (#63289) 2022-07-13 13:50:15 +00:00
_lazy_ts_backend.pyi Dynamo+LTC: merging related code from staging branch to master (#75046) 2022-04-02 00:23:15 +00:00
_lazy.pyi Add step closures (#84300) 2022-09-06 20:55:34 +00:00
_monitor.pyi torch/monitor: merge Interval and FixedCount stats (#72009) 2022-01-30 23:21:59 +00:00
_nn.pyi.in Enable fp32/bf16 PRelu forward and backward in MkldnnCPU path (#60427) 2022-05-10 17:29:11 +00:00
_nvtx.pyi [PyTorch] Support NVTX range_start and range_end (#70030) 2022-02-07 17:31:57 +00:00
_onnx.pyi Allow caffe2-specific graph transformations for OperatorExportTypes.ONNX_ATEN_FALLBACK when BUILD_CAFFE2 is ON (#67460) (#68490) 2022-02-10 03:26:48 +00:00
_profiler.pyi [Profiler] Compute unique IDs for Tensors (#85162) 2022-09-25 17:43:49 +00:00
_VariableFunctions.pyi.in Introducing SymInt to Pytorch (for tracing size arithmetic) (master rebase) (#74861) 2022-03-31 21:59:59 +00:00
_verbose.pyi [RFC] enable oneMKL&oneDNN on-demands verbose functinality (#63212) 2022-07-27 23:29:35 +00:00
build.bzl Make all .pyi.in files exportable from torch/_C/ folder (#74962) 2022-03-31 12:54:14 +00:00
return_types.pyi.in Add typing for torch.return_type 2022-03-29 02:17:21 +00:00