PyTorch Developer Podcast

API design via lexical and dynamic scoping


Listen Later

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.

  • Me unsuccessfully asking around if there was a way to simulate __future__ in libraries https://stackoverflow.com/questions/66927362/way-to-opt-into-bc-breaking-changes-on-methods-within-a-single-module
  • A very old issue asking for a way to change the default GPU device https://github.com/pytorch/pytorch/issues/260 and a global GPU flag https://github.com/pytorch/pytorch/issues/7535
  • A more modern issue based off the lexical module idea https://github.com/pytorch/pytorch/issues/27878
  • Array module NEP https://numpy.org/neps/nep-0037-array-module.html
...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

47 ratings


More shows like PyTorch Developer Podcast

View all
Talk Python To Me by Michael Kennedy

Talk Python To Me

592 Listeners

Python Bytes by Michael Kennedy and Brian Okken

Python Bytes

213 Listeners

The Product Podcast by Product School

The Product Podcast

167 Listeners

NerdWallet's Smart Money Podcast by NerdWallet Personal Finance

NerdWallet's Smart Money Podcast

750 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

7,864 Listeners

Naval by Naval

Naval

2,096 Listeners