PyTorch Developer Podcast
PyTorch Developer Podcast
Edward Yang, Team PyTorch
API design via lexical and dynamic scoping
21 minutes Posted Jul 9, 2021 at 1:00 pm.
0:00
21:44
Download MP3
Show notes

Lexical and dynamic scoping are useful tools to reason about various API design choices in PyTorch, related to context managers, global flags, dynamic dispatch, and how to deal with BC-breaking changes. I'll walk through three case studies, one from Python itself (changing the meaning of division to true division), and two from PyTorch (device context managers, and torch function for factory functions).

Further reading.