class_docstr: For integration with MMF's trainer, datasets and other features,
  models needs to inherit this class, call `super`, write a build function,
  write a forward function taking a ``SampleList`` as input and returning a
  dict as output and finally, register it using ``@registry.register_model``
  
  Args:
      config (DictConfig): ``model_config`` configuration from global config.
class_docstr_tok: ["For","integration","with","MMF","'s","trainer",",","datasets","and","other","features",",","models","needs","to","inherit","this","class",",","call","`","super","`",",","write","a","build","function",",","write","a","forward","function","taking","a","``","SampleList","``","as","input","and","returning","a","dict","as","output","and","finally",",","register","it","using","``","@","registry.register_model","``","Args",":","config","(","DictConfig",")",":","``","model_config","``","configuration","from","global","config","."]
docstr: To be implemented by child class. Takes in a ``SampleList`` and
  returns back a dict.
  
  Args:
      sample_list (SampleList): SampleList returned by the DataLoader for
      current iteration
  
  Returns:
      Dict: Dict containing scores object.
docstr_tok: ["To","be","implemented","by","child","class",".","Takes","in","a","``","SampleList","``","and","returns","back","a","dict",".","Args",":","sample_list","(","SampleList",")",":","SampleList","returned","by","the","DataLoader","for","current","iteration","Returns",":","Dict",":","Dict","containing","scores","object","."]
code: def forward(self, sample_list, *args, **kwargs):
      """To be implemented by child class. Takes in a ``SampleList`` and
      returns back a dict.
  
      Args:
          sample_list (SampleList): SampleList returned by the DataLoader for
          current iteration
  
      Returns:
          Dict: Dict containing scores object.
  
      """
      raise NotImplementedError(
          "Forward of the child model class needs to be implemented."
      )
  
imports: import collections
  import logging
  import warnings
  from copy import deepcopy
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Union
  import pytorch_lightning
  from mmf.common.registry import registry
  from mmf.common.report import Report
  from mmf.common.sample import SampleList, to_device
  from mmf.modules.losses import LossConfig, Losses
  from mmf.utils.checkpoint import load_pretrained_model
  from mmf.utils.checkpoint_updater import MMFToPLCheckpointUpdater
  from mmf.utils.download import download_pretrained_model
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_current_device
  from mmf.utils.logger import log_class_usage
  from omegaconf import DictConfig, MISSING, OmegaConf
label_desc: Use image node_id 16 for calling the BaseModel obj's underlying member method code with example usage: obj.forward(sample_list) without return types