code: def _encode_mlm(
      self, sample_list: Dict[str, Tensor], image_embedding: Tensor
  ):
      assert "lm_label_ids" in sample_list
  
      input_ids = sample_list.get(
          "input_ids_masked", sample_list["input_ids"]
      )
      segment_ids = sample_list["segment_ids"]
      text_embedding = self.text_embeddings(input_ids, segment_ids)
  
      embeddings = torch.cat([image_embedding, text_embedding], dim=1)
      attention_mask = self.get_attention_mask(
          sample_list, text_embedding, image_embedding
      )
      sequence, _ = self.encoder(
          embeddings, attention_mask=attention_mask
      )
      if sequence.dim() != 3:
          sequence = sequence.unsqueeze(1)
  
      sample_list["hs_masked_for_mlm"] = sequence
  
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 10 for calling the ViLT obj's underlying member method code with example usage: obj._encode_mlm(sample_list, image_embedding) without return types