class_docstr: Abstract class for meters used in metric stats.
  Every subclass has cached values for some metric
  
  Parameters
  ----------
  min_mode: bool or None
      if set to true, the smaller value is considered better and vice versa;
      if set to None, no optimality is defined.
docstr: indicates whether the current metric reaches optimality
  
  Raises
  ------
  TypeError
      if min_mode is None
docstr_tok: ["indicates","whether","the","current","metric","reaches","optimality","Raises","--","--","--","TypeError","if","min_mode","is","None"]
code: def is_optimal(self) -> bool:
      """
      indicates whether the current metric reaches optimality
  
      Raises
      ------
      TypeError
          if min_mode is None
      """
      if self.min_mode is None:
          raise TypeError("No optimal mode is defined")
      if self.min_mode is True:
          return self.value < self.best
      else:
          return self.value > self.best
  
imports: from __future__ import annotations
  import time
  import warnings
  from abc import ABC, abstractmethod
  from typing import Optional, Union
  from torch import Tensor
  from ..engine.distributed import reduce_value
label_desc: Use image node_id 6 for calling the Meter obj's underlying member method code with example usage: obj.is_optimal() and returns: unknown, unknown