class_docstr: Computes how often integer targets are in the top `K` predictions.
  
  Usage:
  
  ```python
  pred = torch.tensor([[0.1, 0.9, 0.8, 0.4, 0.5, 0.2],
                     [0.05, 0.95, 0, 0.4, 0.5, 0.2]])
  target = torch.tensor([2, 2])
  top5acc = Top5Accuracy()
  top5acc(pred, target)
  assert top5acc.compute() == 0.5
  ```
class_docstr_tok: ["Computes","how","often","integer","targets","are","in","the","top","`","K","`","predictions",".","Usage",":","``","`","python","pred","=","torch.tensor","(","[","[","0.1",",","0.9",",","0.8",",","0.4",",","0.5",",","0.2","]",",","[","0.05",",","0.95",",","0",",","0.4",",","0.5",",","0.2","]","]",")","target","=","torch.tensor","(","[","2",",","2","]",")","top5acc","=","Top5Accuracy","(",")","top5acc","(","pred",",","target",")","assert","top5acc.compute","(",")","==","0.5","``","`"]
code: def __call__(self, preds, targets):
      batch_size = targets.size(0)
      _, preds = preds.topk(5, dim=-1, largest=True, sorted=True)
      preds = preds.type_as(targets).t()
      targets = targets.view(1, -1).expand_as(preds)
  
      # torch.view requests Elements of tensors are stored
      # as a long contiguous vector in memory.
      # So need to call contiguous() before view().
      self.correct += preds.eq(targets).contiguous().view(-1).sum()
      self.total += batch_size
  
imports: import torch
  from abc import ABC, abstractmethod
label_desc: Use image node_id 2 for calling the Top5Accuracy obj's underlying member method code with example usage: obj.__call__(preds, targets) without return types