docstr: Processes a new batch of predictions and targets for computing the metric.
  
  Args:
      predictions: model outputs for the current batch
      target: labels for the current batch
      extras: dict containing extra information.
          During training this includes "loss" and "grad_norm" keys.
          During validaiton only includes "loss".
      batch_size: optionally used to correctly compute the averages when
          the batch size varies across batches.
docstr_tok: ["Processes","a","new","batch","of","predictions","and","targets","for","computing","the","metric",".","Args",":","predictions",":","model","outputs","for","the","current","batch","target",":","labels","for","the","current","batch","extras",":","dict","containing","extra","information",".","During","training","this","includes","``","loss","''","and","``","grad_norm","''","keys",".","During","validaiton","only","includes","``","loss","''",".","batch_size",":","optionally","used","to","correctly","compute","the","averages","when","the","batch","size","varies","across","batches","."]
code: def update(
      self,
      prediction: Union[Tensor, Dict],
      target: Union[Tensor, Dict],
      extras: Dict[str, Any],
      batch_size: Optional[int] = 1,
  ) -> None:
      """
      Processes a new batch of predictions and targets for computing the metric.
  
      Args:
          predictions: model outputs for the current batch
          target: labels for the current batch
          extras: dict containing extra information.
              During training this includes "loss" and "grad_norm" keys.
              During validaiton only includes "loss".
          batch_size: optionally used to correctly compute the averages when
              the batch size varies across batches.
      """
      raise NotImplementedError
  
imports: import abc
  import argparse
  from numbers import Number
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from utils import logger
  from utils.tensor_utils import all_gather_list, reduce_tensor_sum, tensor_to_python_float
label_desc: Use image node_id 4 for calling the BaseMetric obj's underlying member method code with example usage: obj.update(prediction, target, extras, batch_size) without return types