Solved by ptrblck in post #2 
              
              
                I cannot reproduce the issue and both approaches work as expected: 
criterion = nn.MSELoss()

x = torch.randn(10, 10)
y = torch.randn(10, 10).double()

loss = criterion(x, y)

class MSLELoss(nn.Module):
    def __init__(self):
        super().__init__()
        self.mse = nn.MSELoss()
        
    d…