def __init__(
        self,
        *metrics: Union["PluginMetric", Sequence["PluginMetric"]],
        loggers: Optional[
            Union[
                "BaseLogger",
                Sequence["BaseLogger"],
                Callable[[], Sequence["BaseLogger"]],
            ]
        ] = None,
        collect_all=True,
        strict_checks=False
    ):
        """Creates an instance of the evaluation plugin.

        :param metrics: The metrics to compute.
        :param loggers: The loggers to be used to log the metric values.
        :param collect_all: if True, collect in a separate dictionary all
            metric curves values. This dictionary is accessible with
            `get_all_metrics` method.
        :param strict_checks: if True, checks that the full evaluation streams
            is used when calling `eval`. An error will be raised otherwise.
        """
        super().__init__()
        self.supports_distributed = True
        self.collect_all = collect_all
        self.strict_checks = strict_checks

        flat_metrics_list = []
        for metric in metrics:
            if isinstance(metric, Sequence):
                flat_metrics_list += list(metric)
            else:
                flat_metrics_list.append(metric)
        self.metrics = flat_metrics_list

        if loggers is None:
            loggers = []
        elif callable(loggers):
            loggers = loggers()
        elif not isinstance(loggers, Sequence):
            loggers = [loggers]

        self.loggers: Sequence["BaseLogger"] = loggers

        if len(self.loggers) == 0 and DistributedHelper.is_main_process:
            warnings.warn("No loggers specified, metrics will not be logged")

        self.all_metric_results: Dict[str, Tuple[List[int], List[Any]]]
        if self.collect_all:
            # for each curve collect all emitted values.
            # dictionary key is full metric name.
            # Dictionary value is a tuple of two lists.
            # first list gathers x values (indices representing
            # time steps at which the corresponding metric value
            # has been emitted)
            # second list gathers metric values
            # SERIALIZATION NOTICE: don't use a lambda here, otherwise
            # serialization may fail in some cases.
            self.all_metric_results = defaultdict(_init_metrics_list_lambda)
        else:
            self.all_metric_results = dict()

        # Dictionary of last values emitted. Dictionary key
        # is the full metric name, while dictionary value is
        # metric value.
        self.last_metric_results: Dict[str, Any] = {}

        self._active = True
        """If False, no metrics will be collected."""

        self._metric_values: List[MetricValue] = []
        """List of metrics that have yet to be processed by loggers."""
Creates an instance of the evaluation plugin.

        :param metrics: The metrics to compute.
        :param loggers: The loggers to be used to log the metric values.
        :param collect_all: if True, collect in a separate dictionary all
            metric curves values. This dictionary is accessible with
            `get_all_metrics` method.
        :param strict_checks: if True, checks that the full evaluation streams
            is used when calling `eval`. An error will be raised otherwise.
        
avalanche/training/plugins/evaluation.py