class_docstr: Confusion Matrix metric compatible with Weights and Biases logger.
  Differently from the `StreamConfusionMatrix`, this metric will use W&B
  built-in functionalities to log the Confusion Matrix.
  
  This metric may not produce meaningful outputs with other loggers.
  
  https://docs.wandb.ai/guides/track/log#custom-charts
class_docstr_tok: ["Confusion","Matrix","metric","compatible","with","Weights","and","Biases","logger",".","Differently","from","the","`","StreamConfusionMatrix","`",",","this","metric","will","use","W","&","B","built-in","functionalities","to","log","the","Confusion","Matrix",".","This","metric","may","not","produce","meaningful","outputs","with","other","loggers",".","https",":","\/\/docs.wandb.ai\/guides\/track\/log","#","custom-charts"]
docstr: :param class_names: list of names for the classes.
      E.g. ["cat", "dog"] if class 0 == "cat" and class 1 == "dog"
      If None, no class names will be used. Default None.
docstr_tok: [":","param","class_names",":","list","of","names","for","the","classes",".","E.g",".","[","``","cat","''",",","``","dog","''","]","if","class","0","==","``","cat","''","and","class","1","==","``","dog","''","If","None",",","no","class","names","will","be","used",".","Default","None","."]
code: def __init__(self, class_names=None):
      """
      :param class_names: list of names for the classes.
          E.g. ["cat", "dog"] if class 0 == "cat" and class 1 == "dog"
          If None, no class names will be used. Default None.
      """
  
      super().__init__()
  
      self.outputs = []  # softmax-ed or logits outputs
      self.targets = []  # target classes
      self.class_names = class_names
  
imports: from matplotlib.figure import Figure
  from numpy import arange
  from typing_extensions import Literal
  from typing import Any, Callable, Iterable, Union, Optional, TYPE_CHECKING, List
  import wandb
  import numpy
  import torch
  from PIL.Image import Image
  from torch import Tensor
  from torch.nn.functional import pad
  from avalanche.benchmarks import NCScenario
  from avalanche.evaluation import PluginMetric, Metric
  from avalanche.evaluation.metric_results import AlternativeValues, MetricValue, MetricResult
  from avalanche.evaluation.metric_utils import default_cm_image_creator, phase_and_task, stream_type
label_desc: Use image node_id 1 to create a new WandBStreamConfusionMatrix object from inherited base classes: PluginMetric with example: obj = WandBStreamConfusionMatrix(class_names)