code: def add(self, output, target):
      if torch.is_tensor(output):
          output = output.cpu().squeeze().numpy()
      if torch.is_tensor(target):
          target = np.atleast_1d(target.cpu().squeeze().numpy())
      elif isinstance(target, numbers.Number):
          target = np.asarray([target])
      if np.ndim(output) == 1:
          output = output[np.newaxis]
      else:
          if np.ndim(output) != 2:
              raise AssertionError(
                  "wrong output size (1D or 2D expected)"
              )
          if np.ndim(target) != 1:
              raise AssertionError("target and output do not match")
      if target.shape[0] != output.shape[0]:
          raise AssertionError("target and output do not match")
      topk = self.topk
      maxk = int(
          topk[-1]
      )  # seems like Python3 wants int and not np.int64
      no = output.shape[0]
  
      pred = (
          torch.from_numpy(output).topk(maxk, 1, True, True)[1].numpy()
      )
      correct = pred == target[:, np.newaxis].repeat(pred.shape[1], 1)
  
      for k in topk:
          self.sum[k] += no - correct[:, 0:k].sum()
      self.n += no
  
file_path: pywick/pywick/meters/classerrormeter.py
imports: import numpy
  import torch
  import numbers
  from .None import meter
label_desc: Use image node_id 3 for calling the ClassErrorMeter obj's underlying member method code with example usage: obj.add(output, target) without return types