docstr: Computes the metrics with the existing data.
  
  It gets called at every log iteration as well as the end of each epoch,
  e.g. train, val, valEMA.
  Logging happens at iteration 1 and every `common.log_freq` thereafter.
  
  Note: for computationally heavy metrics, you may want to increase `common.log_freq`.
  
  Returns:
      Depending on the metric, can return a scalar metric or a dictionary of metrics.
      Lists (or dicts of lists) are also generally accepted but not encouraged.
docstr_tok: ["Computes","the","metrics","with","the","existing","data",".","It","gets","called","at","every","log","iteration","as","well","as","the","end","of","each","epoch",",","e.g",".","train",",","val",",","valEMA",".","Logging","happens","at","iteration","1","and","every","`","common.log_freq","`","thereafter",".","Note",":","for","computationally","heavy","metrics",",","you","may","want","to","increase","`","common.log_freq","`",".","Returns",":","Depending","on","the","metric",",","can","return","a","scalar","metric","or","a","dictionary","of","metrics",".","Lists","(","or","dicts","of","lists",")","are","also","generally","accepted","but","not","encouraged","."]
code: def compute(
      self,
  ) -> Union[Number, Dict[str, Number]]:
      """
      Computes the metrics with the existing data.
  
      It gets called at every log iteration as well as the end of each epoch,
      e.g. train, val, valEMA.
      Logging happens at iteration 1 and every `common.log_freq` thereafter.
  
      Note: for computationally heavy metrics, you may want to increase `common.log_freq`.
  
      Returns:
          Depending on the metric, can return a scalar metric or a dictionary of metrics.
          Lists (or dicts of lists) are also generally accepted but not encouraged.
      """
      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 5 for calling the BaseMetric obj's underlying member method code with example usage: obj.compute() without return types