PyTorch Developer Podcast

Binding C++ objects to Python


Listen Later

In this episode, we will discuss how to bind a C++ object in Python? We'll try to answer the following questions: How does pybind11 do it? What's different about how we implement it for Tensor? What are some downsides of the approach?

Note from the future: I recorded and then decided I didn't like my follow up episode about how to preserve PyObjects even when they go dead in Python. Maybe some day!

Further reading:

  • Python bindings for Tensor in PyTorch https://github.com/.../csrc/autograd/python_variable.cpp
  • pybind11 hash map for maintaining object identity https://github.com/.../inc.../pybind11/detail/internals.h...
  • Tensor subclasses don't save their properties https://github.com/pytorch/pytorch/issues/47117
    (but the situation here is more complicated than I imply in the podcast)
...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,874 Listeners

Naval by Naval

Naval

2,096 Listeners