Add a common autograd TLS state (#63860)
authorAlban Desmaison <albandes@fb.com>
Tue, 24 Aug 2021 22:32:42 +0000 (15:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 24 Aug 2021 22:34:06 +0000 (15:34 -0700)
commit41ffec07ce8abfffd3f4f450ae442a8f5982a074
treeaf9fa6820c2a3f5f7d7423150f5726d873781b1d
parent865d127a66e961b12f895747c3c59bd7503223dd
Add a common autograd TLS state (#63860)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63860

Test Plan: Imported from OSS

Reviewed By: heitorschueroff

Differential Revision: D30513253

Pulled By: albanD

fbshipit-source-id: 97d76ed54dfbdf4ba3fc7051ce3b9bb636cefb4b
aten/src/ATen/ThreadLocalState.cpp
aten/src/ATen/ThreadLocalState.h
c10/core/AutogradState.cpp [new file with mode: 0644]
c10/core/AutogradState.h [new file with mode: 0644]
c10/core/GradMode.cpp
c10/core/InferenceMode.cpp
c10/core/InferenceMode.h