1 | #pragma once |
2 | |
3 | #include <ATen/core/dispatch/Dispatcher.h> |
4 | |
5 | // TODO: this can probably live in c10 |
6 | |
7 | namespace at { |
8 | namespace impl { |
9 | |
10 | class TORCH_API PythonOpRegistrationTrampoline final { |
11 | static std::atomic<c10::impl::PyInterpreter*> interpreter_; |
12 | |
13 | public: |
14 | // Returns true if you successfully registered yourself (that means |
15 | // you are in the hot seat for doing the operator registrations!) |
16 | static bool registerInterpreter(c10::impl::PyInterpreter*); |
17 | }; |
18 | |
19 | } // namespace impl |
20 | } // namespace at |
21 | |