This piece:
precision1 = torch.exp(-self.log_vars[0])
loss = torch.sum(precision1 * (targets[0] - outputs[0]) ** 2. + self.log_vars[0], -1)

precision2 = torch.exp(-self.log_vars[1])
loss += torch.sum(precision2 * (targets[1] - outputs[1]) ** 2. + self.log_vars[1], -1)

seems to be summing log-likelihoods of two normal distributions. But as their precisions differ, their densities are scaled differently and are thus not comparable. That loss works though, at least with no shared parameters, you just have to examine part losses separately.
Now, with classification losses, underlying distributions have no precision parameters, so simple unweighted sum of losses should work. Indeed, trainable loss weights may easily screw things up. Again, shared parameters may impede training, but otherwise for loss = loss1+loss2, autograd.backward([loss]) is the same as autograd.backward([loss1,loss2]) (i.e. independent backprops) as SumBackward doesn’t change gradients (and MeanBackward just divides gradients by a constant).