class_docstr: Measures top-k accuracy of multi-class predictions.
class_docstr_tok: ["Measures","top-k","accuracy","of","multi-class","predictions","."]
code: def add(self, output, ground_truth):
      # compute predicted classes (ordered):
      _, prediction = output.topk(self.maxk, 1, True, True)
      prediction = prediction.t()
  
      # store correctness values:
      correct = prediction.eq(
          ground_truth.view(1, -1).expand_as(prediction)
      )
      self.values.append(correct[: self.maxk])
  
file_path: CrypTen/examples/meters.py
imports: import torch
label_desc: Use image node_id 3 for calling the AccuracyMeter obj's underlying member method code with example usage: obj.add(output, ground_truth) without return types