code: def _infer_itm_labels(
      self, sample_list: Dict[str, Tensor]
  ) -> Dict[str, Tensor]:
      input_ids = sample_list["input_ids"]
      itm_labels = {}
      if "is_correct" in sample_list:
          itm_labels["is_correct"] = sample_list["is_correct"]
      else:
          itm_labels["is_correct"] = torch.tensor(
              True, dtype=torch.long, device=input_ids.device
          )
  
      return itm_labels
  
imports: import collections.abc
  import logging
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.models.transformers.heads.utils import build_heads_dict
  from mmf.modules.encoders import TransformerEncoder, ViTEncoder
  from mmf.modules.losses import MMFLoss
  from mmf.utils.build import build_encoder
  from mmf.utils.modeling import get_bert_configured_parameters
  from omegaconf import MISSING, OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 8 for calling the ViLT obj's underlying member method code with example usage: obj._infer_itm_labels(sample_list) and returns: itm_labels