code: def compute_mlm_loss(logits, masked_lm_labels):
      vocab_size = logits.shape[-1]
      loss_fct = nn.CrossEntropyLoss()
      return loss_fct(
          logits.view(-1, vocab_size), masked_lm_labels.view(-1)
      )
  
imports: import abc
  import torch
  import torch.nn
  from typing import Callable
  import jiant.proj.main.modeling.heads
  from jiant.proj.main.components.outputs import LogitsAndLossOutput
  from jiant.proj.main.components.outputs import LogitsOutput
  from jiant.utils.python.datastructures import take_one
  from jiant.tasks.core import TaskTypes
label_desc: Use image node_id 1 for calling a global function with example usage: compute_mlm_loss(logits, masked_lm_labels) and returns: loss_fct