• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <ATen/core/VariableHooksInterface.h>
2 
3 namespace at::impl {
4 
5 namespace {
6 VariableHooksInterface* hooks = nullptr;
7 }
8 
SetVariableHooks(VariableHooksInterface * h)9 void SetVariableHooks(VariableHooksInterface* h) {
10   hooks = h;
11 }
GetVariableHooks()12 VariableHooksInterface* GetVariableHooks() {
13   TORCH_CHECK(hooks, "Support for autograd has not been loaded; have you linked against libtorch.so?")
14   return hooks;
15 }
HasVariableHooks()16 bool HasVariableHooks() {
17   return hooks != nullptr;
18 }
19 
20 } // namespace at::impl
21