I see,  thank you so much for your brief explanation, how about the combination? like this:
criterion = nn.CrossEntropyLoss(weight=weight_value)
loss = criterion(outputs, labels)
dice = dice_loss(preds, labels.data)
loss = loss+dice

So when I called loss.backward() will it compute both losses gradient? or do I need to do 2 times backward for each loss?