code: def _infer_mlm_labels(
      self,
      sample_list: Dict[str, Tensor],
      image_embeddings_size: Tuple[int, int],
  ):
      input_ids = sample_list["input_ids"]
      mlm_labels = {}
      current_text_idx = 0
      if "lm_label_ids" in sample_list:
          if sample_list["lm_label_ids"].dim() > 2:
              mlm_labels["text"] = sample_list["lm_label_ids"][
                  :, current_text_idx
              ]
              current_text_idx += 1
          else:
              mlm_labels["text"] = sample_list["lm_label_ids"]
      else:
          mlm_labels["text"] = torch.full(
              input_ids.size(),
              fill_value=-1,
              dtype=torch.long,
              device=input_ids.device,
          )
      mlm_labels["image"] = torch.full(
          image_embeddings_size,
          fill_value=-1,
          dtype=torch.long,
          device=input_ids.device,
      )
      mlm_labels["combined_labels"] = torch.cat(
          [mlm_labels["text"], mlm_labels["image"]], dim=-1
      )
      return mlm_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 9 for calling the ViLT obj's underlying member method code with example usage: obj._infer_mlm_labels(sample_list, image_embeddings_size) and returns: mlm_labels