code: def add_custom_params(self, sample_list):
      visual_embeddings = getattr(
          sample_list, "visual_embeddings", None
      )
      image_dim = getattr(sample_list, "image_dim", None)
      # pretraining labels
      sample_list.masked_lm_labels = getattr(
          sample_list, "lm_label_ids", None
      )
      # image_feat_variable = batch x ( num_choice x ) image_feature_length x dim
      # Prepare Mask
      if visual_embeddings is not None and image_dim is not None:
          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()
      else:
          sample_list.image_mask = None
  
      sample_list.position_embeddings_visual = None
      sample_list.visual_embeddings_type = None
      sample_list.image_text_alignment = None
      return sample_list
  
imports: import logging
  import math
  import os
  import torch
  from mmf.common.registry import registry
  from mmf.models import BaseModel
  from mmf.modules.embeddings import BertVisioLinguisticEmbeddings
  from mmf.utils.configuration import get_mmf_cache_dir
  from mmf.utils.file_io import PathManager
  from mmf.utils.modeling import get_optimizer_parameters_for_bert
  from mmf.utils.transform import transform_to_batch_sequence, transform_to_batch_sequence_dim
  from omegaconf import OmegaConf
  from torch import nn
label_desc: Use image node_id 7 for calling the VisualBERTModule obj's underlying member method code with example usage: obj.add_custom_params(sample_list) and returns: sample_list