class_docstr: VinVL Bert Encoder for image features
  From https://github.com/microsoft/Oscar/blob/master/oscar/modeling/modeling_bert.py
  Is a thin wrapper around BertEncoder that handles image features
code: def __init__(self, config: BertConfig):
      super().__init__(config)
      self.embeddings = BertEmbeddings(config)
      self.encoder = BertEncoder(config)
  
      self.img_dim = config.img_feature_dim
      self.use_img_layernorm = getattr(
          config, "use_img_layernorm", False
      )
  
      img_projection = nn.Linear(
          self.img_dim, self.config.hidden_size, bias=True
      )
      img_embedding_list = [img_projection]
      if self.use_img_layernorm:
          img_embedding_list += [
              nn.LayerNorm(
                  config.hidden_size, eps=config.img_layer_norm_eps
              )
          ]
      dropout = nn.Dropout(config.hidden_dropout_prob)
      img_embedding_list += [dropout]
      # is an image encoding used as input to the transformer trunk
      self.img_embedding = nn.Sequential(*img_embedding_list)
  
imports: import logging
  from collections import namedtuple
  from dataclasses import asdict, dataclass
  from typing import Any, Dict, Optional, Tuple
  import torch
  from mmf.common.registry import registry
  from mmf.common.sample import SampleList
  from mmf.models.base_model import BaseModel
  from mmf.models.transformers.heads.contrastive import ThreeWayContrastive
  from mmf.models.transformers.heads.mlm import MLM
  from mmf.models.transformers.heads.mlp import MLP
  from mmf.utils.general import retry_n
  from omegaconf import MISSING, OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 1 to create a new VinVLBase object from inherited base classes: BertPreTrainedModel with example: obj = VinVLBase(config)