class_docstr: Compute a classification report as a metric.
  
  Args:
      num_classes (int): the number of classes.
class_docstr_tok: ["Compute","a","classification","report","as","a","metric",".","Args",":","num_classes","(","int",")",":","the","number","of","classes","."]
docstr: Update the confusion matrice according to output and target.
  
  Args:
      output (tensor): predictions of model
      target (tensor): labels
docstr_tok: ["Update","the","confusion","matrice","according","to","output","and","target",".","Args",":","output","(","tensor",")",":","predictions","of","model","target","(","tensor",")",":","labels"]
code: def update(self, output=None, target=None):
      """
      Update the confusion matrice according to output and target.
  
      Args:
          output (tensor): predictions of model
          target (tensor): labels
      """
      output = output.detach().cpu().numpy()
      target = target.detach().cpu().numpy()
  
      if output.ndim > target.ndim:
          # Argmax not done
          output = output.argmax(1)  # 1 is always our class axis.
  
      self.class_data += confusion_matrix(
          target.reshape([-1]).astype(int),
          output.reshape([-1]).astype(int),
          labels=np.arange(self.class_data.shape[0]),
      )
  
imports: import dataclasses
  import math
  import warnings
  from collections import defaultdict
  import numpy
  import torch
  from sklearn.metrics import confusion_matrix, auc
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 3 for calling the ClassificationReport obj's underlying member method code with example usage: obj.update(output, target) without return types