code: def __call__(self, lm_logits, clf_logits, lm_labels, clf_labels):
      lm_logits = lm_logits.transpose(0, 1).contiguous()
  
      loss_fct = torch.nn.CrossEntropyLoss(ignore_index=-1)
      loss_clf = loss_fct(
          clf_logits.view(-1, clf_logits.size(-1)), clf_labels.view(-1)
      )
  
      shift_logits = lm_logits[:-1] if self.causal else lm_logits
      shift_labels = lm_labels[1:] if self.causal else lm_labels
      loss_fct = torch.nn.CrossEntropyLoss(ignore_index=-1)
      loss_lm = loss_fct(
          shift_logits.view(-1, shift_logits.size(-1)),
          shift_labels.view(-1),
      )
  
      return loss_lm, loss_clf
  
imports: import torch
  from pytorch_pretrained_bert import BertTokenizer
  from transfer_nlp.plugins.config import register_plugin
label_desc: Use image node_id 2 for calling the MultiTaskLoss obj's underlying member method code with example usage: obj.__call__(lm_logits, clf_logits, lm_labels, clf_labels) and returns: loss_lm,  loss_clf