Is it possible to weight the losses when multiple losses are used and how? Is it correct by using the following code?
    mse_loss = nn.MSELoss(size_average=True)
    a = weight1 * mse_loss(inp, target1)
    b = weight2 * mse_loss(inp, target2)
    loss = a + b

    loss.backward()