[pycharm] Why I can not debug the backward method of Function class?

I implemented a subclass of torch.autograd.Function class and its forward and backward function. I use Pycharm IDE. I add a breakpoint in backward function and wanted to debug the script , then I found the program did not stop at the breakpoint . I do not know why. It works well in other part of the script,even in forward function.

I thought it is the pycharm’s problem ,but when I run the script in another computer with pycharm ,the problem disappear . I mean it stop just the breakpoint.

The problem drives me mad. so if anyone how to solve the problem ,please help me.

1 Like

do you have different PyCharm versions in either machines?
Or maybe you have different PyTorch versions in either machines?

I firstly used the pycharm 2017.1.2 and pytorch 0.1.11_5, then I ran the code in the computer with pycharm 2016.2.3 and pytorch 0.1.9.
The debug program could stop at the breakpoint when I ran code in the latter machines in which both software version are older. That confused me.

Pycharm can be buggy at times, I’ve encountered the problem of breakpoints being ignored in the past, I’d guess it is not related to pytorch.