code: def add_custom_params(
      self, sample_list: Dict[str, Tensor]
  ) -> Dict[str, Tensor]:
      visual_embeddings = sample_list["visual_embeddings"]
      image_dim = sample_list["image_dim"]
  
      if self.training_head_type == "pretraining":
          # pretraining labels
          sample_list["masked_lm_labels"] = sample_list["lm_label_ids"]
      # image_feat_variable = batch x ( num_choice x ) image_feature_length x dim
      # Prepare Mask
      image_mask = torch.arange(
          visual_embeddings.size(-2), device=visual_embeddings.device
      ).expand(visual_embeddings.size()[:-1])
      if len(image_dim.size()) < len(image_mask.size()):
          image_dim = image_dim.unsqueeze(-1)
          assert len(image_dim.size()) == len(image_mask.size())
      image_mask = image_mask < image_dim
      sample_list["image_mask"] = image_mask.long()
  
      return sample_list
  
imports: import os
  from copy import deepcopy
  from typing import Dict, List, Optional, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.models import BaseModel
  from mmf.modules.embeddings import BertVisioLinguisticEmbeddings
  from mmf.modules.hf_layers import BertEncoderJit, BertLayerJit
  from mmf.utils.configuration import get_mmf_cache_dir
  from mmf.utils.modeling import get_optimizer_parameters_for_bert
  from mmf.utils.torchscript import getattr_torchscriptable
  from mmf.utils.transform import transform_to_batch_sequence, transform_to_batch_sequence_dim
  from omegaconf import OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 9 for calling the VisualBERT obj's underlying member method code with example usage: obj.add_custom_params(sample_list) and returns: sample_list