Hi @caonv Thanks for the answer.
I have wrote some code based on your suggestion. Could you check once. Is this the correct way
 w1 = torch.randn(1)
 w2 = torch.randn(1)
 issue_loss_fn = nn.CrossEntropyLoss()
 product_loss_fn = nn.CrossEntropyLoss()
 issue_loss = w1 * issue_loss_fn(issue_logits, issue_y)
 product_loss = w2 * product_loss_fn(pro_logits, issue_y)
 loss = issue_loss + product_loss
 loss.backward()