Solved by ptrblck in post #2 
              
              
                If you’ve just wrapped the loss function using nn.MSELoss into your custom class, both approaches should work identically. 
Is the slower training reproducible? 
Also, in your second script it looks like you are not initializing nn.MSELoss but just pass the input and target values directly. Is this …