There are no other inplace operations here.
I would double check that I didn’t missed any inplace relu or some other code that does inplace operation, If that doesn’t solve it, a good way to debug this is to remove part of the net, and add a .sum().backward() in the middle, to check that everything above is correct, or use .detach() in the middle (that will prevent backprop from going above) to check that the bottom part of you net is correct. (Here top means where the input is, and bottom is where the output is  ).