it’s the last Sigmoid rectification…
self.m = nn.Sigmoid()
: 
: 
out = self.m(out)

I have not found a solution to this. It seems that using a Sigmoid activation on the outpout layer (so that the output remains between 0 and 1) causes a problem with the auto differentiation during backward propagation.
Sigmoid() works just fine before the output layer!  And there is no “inplace=False” flag!
Did you ever find a solution??