class_docstr: The result of a Metric.
  
  A result has a name, a value and a "x" position in which the metric value
  should be plotted.
  
  The "value" field can also be an instance of "AlternativeValues", in which
  case it means that alternative representations exist for this value. For
  instance, the Confusion Matrix can be represented both as a Tensor and as
  an Image. It's up to the Logger, according to its capabilities, decide which
  representation to use.
docstr: Creates an instance of MetricValue.
  
  :param origin: The originating Metric instance.
  :param name: The display name of this value. This value roughly
      corresponds to the name of the plot in which the value should
      be logged.
  :param value: The value of the metric. Can be a scalar value,
      a PIL Image, or a Tensor. If more than a possible representation
      of the same value exist, an instance of :class:`AlternativeValues`
      can be passed. For instance, the Confusion Matrix can be represented
      both as an Image and a Tensor, in which case an instance of
      :class:`AlternativeValues` carrying both the Tensor and the Image
      is more appropriate. The Logger instance will then select the most
      appropriate way to log the metric according to its capabilities.
  :param x_plot: The position of the value. This value roughly corresponds
      to the x-axis position of the value in a plot. When logging a
      singleton value, pass 0 as a value for this parameter.
  :param logging_type: determines how the metric should be logged.
docstr_tok: ["Creates","an","instance","of","MetricValue",".",":","param","origin",":","The","originating","Metric","instance",".",":","param","name",":","The","display","name","of","this","value",".","This","value","roughly","corresponds","to","the","name","of","the","plot","in","which","the","value","should","be","logged",".",":","param","value",":","The","value","of","the","metric",".","Can","be","a","scalar","value",",","a","PIL","Image",",","or","a","Tensor",".","If","more","than","a","possible","representation","of","the","same","value","exist",",","an","instance","of",":","class",":","`","AlternativeValues","`","can","be","passed",".","For","instance",",","the","Confusion","Matrix","can","be","represented","both","as","an","Image","and","a","Tensor",",","in","which","case","an","instance","of",":","class",":","`","AlternativeValues","`","carrying","both","the","Tensor","and","the","Image","is","more","appropriate",".","The","Logger","instance","will","then","select","the","most","appropriate","way","to","log","the","metric","according","to","its","capabilities",".",":","param","x_plot",":","The","position","of","the","value",".","This","value","roughly","corresponds","to","the","x-axis","position","of","the","value","in","a","plot",".","When","logging","a","singleton","value",",","pass","0","as","a","value","for","this","parameter",".",":","param","logging_type",":","determines","how","the","metric","should","be","logged","."]
code: def __init__(
      self,
      origin: "Metric",
      name: str,
      value: Union[MetricType, AlternativeValues],
      x_plot: int,
      logging_type: LoggingType = LoggingType.ANY,
  ):
      """
      Creates an instance of MetricValue.
  
      :param origin: The originating Metric instance.
      :param name: The display name of this value. This value roughly
          corresponds to the name of the plot in which the value should
          be logged.
      :param value: The value of the metric. Can be a scalar value,
          a PIL Image, or a Tensor. If more than a possible representation
          of the same value exist, an instance of :class:`AlternativeValues`
          can be passed. For instance, the Confusion Matrix can be represented
          both as an Image and a Tensor, in which case an instance of
          :class:`AlternativeValues` carrying both the Tensor and the Image
          is more appropriate. The Logger instance will then select the most
          appropriate way to log the metric according to its capabilities.
      :param x_plot: The position of the value. This value roughly corresponds
          to the x-axis position of the value in a plot. When logging a
          singleton value, pass 0 as a value for this parameter.
      :param logging_type: determines how the metric should be logged.
      """
      self.origin: "Metric" = origin
      self.name: str = name
      self.value: Union[MetricType, AlternativeValues] = value
      self.x_plot: int = x_plot
      self.logging_type = logging_type
  
file_path: avalanche/avalanche/evaluation/metric_results.py
imports: from dataclasses import dataclass
  from typing import List, Optional, TYPE_CHECKING, Tuple, Union
  from PIL.Image import Image
  from matplotlib.figure import Figure
  from torch import Tensor
  from enum import Enum
label_desc: Use image node_id 1 to create a new MetricValue object from inherited base classes: object with example: obj = MetricValue(origin, name, value, x_plot, logging_type)