PyTorch Developer Podcast

PyObject preservation


Listen Later

Given two separately refcounted objects, how can you arrange for each of them to stay live so long as the other is live? Why doesn't just having a strong-strong or strong-weak reference between the two objects work? What is object resurrection in CPython? What's a finalizer and why does it make things more complicated? How does Python GC work?

Further reading.

  • PyObject preservation PR https://github.com/pytorch/pytorch/pull/56017
  • Sam Gross's original PoC, which works fine if the two objects in question are both PyObjects https://github.com/colesbury/refcount/
  • PEP 442 Safe object finalization https://www.python.org/dev/peps/pep-0442/
  • Essential reading about Python GC https://devguide.python.org/garbage_collector/
...more
View all episodesView all episodes
Download on the App Store

PyTorch Developer PodcastBy Edward Yang, Team PyTorch

  • 4.8
  • 4.8
  • 4.8
  • 4.8
  • 4.8

4.8

49 ratings


More shows like PyTorch Developer Podcast

View all
Talk Python To Me by Michael Kennedy

Talk Python To Me

585 Listeners

Science Weekly by The Guardian

Science Weekly

416 Listeners

Cautionary Tales with Tim Harford by Pushkin Industries

Cautionary Tales with Tim Harford

5,179 Listeners

All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

All-In with Chamath, Jason, Sacks & Friedberg

9,901 Listeners