def loss(self, x, labels):
    (label_1, label_2) = labels
    result = self.forward(x)
    result.loss1 = self.task1.loss(result.out1, label_1)
    result.loss2 = self.task2.loss(result.out2, label_2)
    result.loss = (result.loss1 + (self.cfg.TRAIN.TASK2_FACTOR * result.loss2))
    return result
def loss(self, x, labels):
    (label_1, label_2) = labels
    result = self.forward(x)
    result.loss1 = self.task1.loss(result.out1, label_1)
    result.loss2 = self.task2.loss(result.out2, label_2)
    result.loss = (result.loss1 + (self.cfg.TRAIN.TASK2_FACTOR * result.loss2))
    return result