class_docstr: Monitoring metric object. Supports two types of reduction: mean and sum.
docstr: Computes the result according to the reduction procedure.
  
  Returns
  -------
  Monitoring metric.
docstr_tok: ["Computes","the","result","according","to","the","reduction","procedure",".","Returns","--","--","--","-","Monitoring","metric","."]
code: def result(self) -> Dict[str, float]:
      """
      Computes the result according to the reduction procedure.
  
      Returns
      -------
      Monitoring metric.
      """
      if self.reduction == Reduction.SUM:
          return {self.name: self.total}
  
      if self.reduction == Reduction.MEAN:
          return {self.name: np.nan_to_num(self.total / self.count)}
  
      raise NotImplementedError(
          f"Reduction {self.reduction} not implemented"
      )
  
imports: import torch
  import numpy
  from enum import Enum
  from abc import ABC, abstractmethod
  from typing import Dict, Union, Callable
label_desc: Use image node_id 4 for calling the Metric obj's underlying member method code with example usage: obj.result() and returns: dict, dict