class_docstr: callback to be used with LightningTrainer and torchmetric
  Warning: 'optimizer.enable_state_sharding=True' is not supported
code: def on_validation_end(
      self, trainer: Trainer, pl_module: LightningModule
  ):
      iterations = self._get_iterations_for_logging(trainer)
      current_epochs = self._get_current_epoch_for_logging(trainer)
      num_updates = self._get_num_updates_for_logging(trainer)
      max_updates = trainer.max_steps
      extra = {
          "num_updates": num_updates,
          "epoch": current_epochs,
          "iterations": iterations,
          "max_updates": max_updates,
          "val_time": self.snapshot_timer.get_time_since_start(),
      }
      self.train_timer.reset()
      self._log_metrics_and_extra(
          extra, num_updates, max_updates, log_type="val"
      )
      self.lightning_trainer.torchmetrics.reset()
  
imports: import logging
  from typing import Any, Dict, List, Optional
  import torch
  from mmf.common.registry import registry
  from mmf.common.sample import SampleList
  from mmf.utils.timer import Timer
  from pytorch_lightning import LightningModule, Trainer
  from pytorch_lightning.callbacks.base import Callback
label_desc: Use image node_id 6 for calling the LightningTorchMetricsCallback obj's underlying member method code with example usage: obj.on_validation_end(trainer, pl_module) without return types