class_docstr: Manager for logging and metrics.
  
  An evaluation plugin that obtains relevant data from the
  training and eval loops of the strategy through callbacks.
  The plugin keeps a dictionary with the last recorded value for each metric.
  The dictionary will be returned by the `train` and `eval` methods of the
  strategies.
  It is also possible to keep a dictionary with all recorded metrics by
  specifying `collect_all=True`. The dictionary can be retrieved via
  the `get_all_metrics` method.
  
  This plugin also logs metrics using the provided loggers.
class_docstr_tok: ["Manager","for","logging","and","metrics",".","An","evaluation","plugin","that","obtains","relevant","data","from","the","training","and","eval","loops","of","the","strategy","through","callbacks",".","The","plugin","keeps","a","dictionary","with","the","last","recorded","value","for","each","metric",".","The","dictionary","will","be","returned","by","the","`","train","`","and","`","eval","`","methods","of","the","strategies",".","It","is","also","possible","to","keep","a","dictionary","with","all","recorded","metrics","by","specifying","`","collect_all=True","`",".","The","dictionary","can","be","retrieved","via","the","`","get_all_metrics","`","method",".","This","plugin","also","logs","metrics","using","the","provided","loggers","."]
docstr: Publish a MetricValue to be processed by the loggers.
docstr_tok: ["Publish","a","MetricValue","to","be","processed","by","the","loggers","."]
code: def publish_metric_value(self, mval: MetricValue):
      """Publish a MetricValue to be processed by the loggers."""
      self._metric_values.append(mval)
  
      name = mval.name
      x = mval.x_plot
      val = mval.value
      if self.collect_all:
          self.all_metric_results[name][0].append(x)
          self.all_metric_results[name][1].append(val)
      self.last_metric_results[name] = val
  
imports: import warnings
  from copy import copy
  from collections import defaultdict
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union, Sequence, TYPE_CHECKING
  from avalanche.distributed.distributed_helper import DistributedHelper
  from avalanche.evaluation.metric_results import MetricValue
  from avalanche.evaluation.metrics import accuracy_metrics, loss_metrics
  from avalanche.logging import InteractiveLogger
label_desc: Use image node_id 4 for calling the EvaluationPlugin obj's underlying member method code with example usage: obj.publish_metric_value(mval) without return types