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: Member function of PL modules. Used only when PL enabled.
  To be implemented by child class. Takes in a ``SampleList``,
  batch_idx and returns back a dict.
  
  Args:
      sample_list (SampleList): SampleList returned by the DataLoader for
      current iteration
  
  Returns:
      Dict
docstr_tok: ["Member","function","of","PL","modules",".","Used","only","when","PL","enabled",".","To","be","implemented","by","child","class",".","Takes","in","a","``","SampleList","``",",","batch_idx","and","returns","back","a","dict",".","Args",":","sample_list","(","SampleList",")",":","SampleList","returned","by","the","DataLoader","for","current","iteration","Returns",":","Dict"]
code: def validation_step(
      self, batch: SampleList, batch_idx: int, *args, **kwargs
  ):
      """Member function of PL modules. Used only when PL enabled.
      To be implemented by child class. Takes in a ``SampleList``,
      batch_idx and returns back a dict.
  
      Args:
          sample_list (SampleList): SampleList returned by the DataLoader for
          current iteration
  
      Returns:
          Dict
      """
      output = self._forward_lightning_step(batch, batch_idx)
      if hasattr(self, "val_meter"):
          report = Report(batch, output).detach()
          self.val_meter.update_from_report(
              report, should_update_loss=False
          )
          report.metrics = self.metrics(report, report)
          self.log_dict(report.metrics)
      return output
  
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 18 for calling the BaseModel obj's underlying member method code with example usage: obj.validation_step(batch, batch_idx) and returns: output