class_docstr: a MMPT wrapper class for MMBert style models.
  TODO: move isolated mask to a subclass.
code: def __init__(self, config, **kwargs):
      super().__init__()
      transformer_config = AutoConfig.from_pretrained(
          config.dataset.bert_name
      )
      self.hidden_size = transformer_config.hidden_size
      self.is_train = False
      if config.dataset.train_path is not None:
          self.is_train = True
      # 0 means no iso; 1-12 means iso up to that layer.
      self.num_hidden_layers = transformer_config.num_hidden_layers
      self.last_iso_layer = 0
      if config.dataset.num_iso_layer is not None:
          self.last_iso_layer = config.dataset.num_iso_layer - 1 + 1
  
      if config.model.mm_encoder_cls is not None:
          mm_encoder_cls = getattr(
              transformermodel, config.model.mm_encoder_cls
          )
          model_config = AutoConfig.from_pretrained(
              config.dataset.bert_name
          )
          model_config.max_video_len = config.dataset.max_video_len
          # TODO: a general way to add parameter for a model.
          model_config.use_seg_emb = config.model.use_seg_emb
          self.mm_encoder = mm_encoder_cls.from_pretrained(
              config.dataset.bert_name, config=model_config
          )
      elif (
          config.model.video_encoder_cls is not None
          and config.model.text_encoder_cls is not None
      ):
          video_encoder_cls = getattr(
              transformermodel, config.model.video_encoder_cls
          )
          model_config = AutoConfig.from_pretrained(
              config.dataset.bert_name
          )
          model_config.max_video_len = config.dataset.max_video_len
          # TODO: make each model a set of config class.
          if hasattr(model_config, "num_layers"):
              model_config.num_layers = (
                  config.model.num_hidden_video_layers
              )
          else:
              model_config.num_hidden_layers = (
                  config.model.num_hidden_video_layers
              )
          self.video_encoder = video_encoder_cls.from_pretrained(
              config.dataset.bert_name, config=model_config
          )
          # exact same NLP model from Huggingface.
          text_encoder_cls = getattr(
              transformermodel, config.model.text_encoder_cls
          )
          self.text_encoder = text_encoder_cls.from_pretrained(
              config.dataset.bert_name
          )
      else:
          raise ValueError(
              "the encoder must be either MM or two backbones."
          )
  
imports: import torch
  from torch import nn
  from .None import transformermodel
label_desc: Use image node_id 1 to create a new MMFusion object from inherited base classes: nn with example: obj = MMFusion(config)