Can we compile cpp torch into pytorch for debugging purpose?

Hi! I am interested in some function in cpp torch, and I think, if I can debug cpp torch, I can understand it better! So can I change some code in cpp version, and then somehow run the code, maybe by compiling it into python?
Thank you!!!

Please correct me if Iā€™m misunderstanding your use case, but in case you would like to change code in some C++ file in the PyTorch backend you could rebuild it and should see the changes.

1 Like

yes!!! That is what I want! How to build it? Sorry, I am not familiar with cpp torch install. Oh, maybe install cpp torch must need to build and then install. So I just need to change it, and then just use cpp version and I can see the difference!

Follow these instructions to build PyTorch from source.

1 Like