class_docstr: computes the precision for each class over epochs.
  Args:
      num_classes (int): number of classes.
      average (bool): a way to output one single value for metrics
                      that are calculated in several trials.
class_docstr_tok: ["computes","the","precision","for","each","class","over","epochs",".","Args",":","num_classes","(","int",")",":","number","of","classes",".","average","(","bool",")",":","a","way","to","output","one","single","value","for","metrics","that","are","calculated","in","several","trials","."]
code: def __init__(self, num_classes: int, average=True, **kwargs):
      self.n_class = num_classes
      super().__init__(average=average)
      self._true_positives = torch.zeros(
          [self.n_class], dtype=torch.float32
      )
      self._positives = torch.zeros([self.n_class], dtype=torch.float32)
  
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 1 to create a new Precision object from inherited base classes: Metrics with example: obj = Precision(num_classes, average)