Open ncullen93 opened 1 month ago
Seems to be something with pytorch and third-party modules generally - e.g. https://github.com/python/cpython/issues/98253. Probably not a big issue but still worrying.
See also nanobind FAQ on the issue https://nanobind.readthedocs.io/en/latest/faq.html#why-am-i-getting-errors-about-leaked-functions-and-types
When torch is loaded and a function errors, there is a reference leak reported when the ipython console is exited. This does not seem to happen in a normal python console and only when torch is loaded. Very weird.. I've seen this a few other times but never reproducible so unsure if it's the same issue or if there's a general reference leak.
Then
exit()
and you get this: