@albanD thanks a lot!
You are very right about gdb, I spend several hours to install gdb and tried to get it work for running python file, but still failed to get it work properly 1
I prefer a simple solution to my problem above: how to check or debug pytorch code all the way from python code to C code or C++ code. If I understand you correctly, it seems the simple solution for me is to pick a C/C++ ide with a debuger. I have been using atom for a while. Is it possible to make atom a proper C/C++ ide? if so, can I use it to check or debug pytorch code from python to C and C++ in one go within atom?
right now, it seems I can compile and run C/C++ in atom OK

atom__c_compileOK.png1662×1262 197 KB

However, I can’t just compile and debug my pytorch code as if it is a C/C++ file.  Also, although it says “compile and debug”, I don’t see any features like gdb or pdb in atom. What should I do from here? Thanks a lot!

atom__c_compileBad.png2026×1258 454 KB