Where are the python bindings to C++?


(Kenneth Miller) #1

I am using the C++ code of pytorch because I have a project in C++, and I need to know where the python code and functions are mapped to C++ functions in the pytorch repository.

Could anybody tell me?


(Thomas V) #2

This is autogrenerated. Do follow the build instructions for PyTorch and then look in torch/csrc/autograd/generated.
The autogeneration code is in tools/autograd (including the template/Function.cpp that includes a lot of backwards definitions). It draws from .cwrap and .yaml files in aten/src/ATen and aten/src/ATen/native.

Best regards

Thomas


(Kenneth Miller) #3

Ah thank you so much. I really needed this. I’m basically using pytorch as though I am a pytorch developer, but I actually am not

Does anybody know where or if there is any documentation on how to build pytorch with debug symbols, or other internal documentation about how it is designed for new incoming pytorch developers? I didn’t see that on the front github page or the pytorch website.

Ok, I’ve built it and am looking through what you said…


(Thomas V) #4

If you set the environment variable DEBUG=1, you get debug builds. I’ve been meaning do write up a guide how things in ATen end up as torch.X, but I never get around to it.

Best regards

Thomas