in torch:
- dispatcher(libtorch)
- python_registrations(libtorch_python)
manage registered kernel functions, like PythonKernelHolder
, which contains SafePyObject
that holds :
- self_interpreter(libtorch_python)
- noop_vtable(libtorch)
for python-aware lifetime management of PyObject. However, above 4 global/static scoped/unscoped variables will be destructed after the program exits with implicit orders, and:
libtorch_python
linkslibtorch
.dispatcher
andpython_registrations
dependself_interpreter
/noop_vtable
.
For now, implicit orders are normal after PR in DEBUG
mode. Should we be explicit about their dependeies? like:
- meyer’s singleton of get scoped static
noop_vtable
. - In
dispatcher
/python_registrations
, explicit call get_noop_vtable ().