使用Player FM应用程序离线!
API design via lexical and dynamic scoping
Manage episode 297084189 series 2921809
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
83集单集
Manage episode 297084189 series 2921809
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
83集单集
Semua episode
×欢迎使用Player FM
Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。