class_docstr: Calculates how often predictions matches labels.
  
  For example, if `y_true` is tensor([1, 2, 3, 4])_ and `y_pred` is tensor([0, 2, 3, 4])
  then the accuracy is 3/4 or .75.  If the weights were specified as
  tensor([1, 1, 0, 0]) then the accuracy would be 1/2 or .5.
  
  Usage:
  
  ```python
  acc = Accuracy()
  acc(torch.tensor([0, 2, 3, 4]), torch.tensor([1, 2, 3, 4]))
  assert acc.compute() == 0.75
  ```
class_docstr_tok: ["Calculates","how","often","predictions","matches","labels",".","For","example",",","if","`","y_true","`","is","tensor","(","[","1",",","2",",","3",",","4","]",")","_","and","`","y_pred","`","is","tensor","(","[","0",",","2",",","3",",","4","]",")","then","the","accuracy","is","3\/4","or",".75",".","If","the","weights","were","specified","as","tensor","(","[","1",",","1",",","0",",","0","]",")","then","the","accuracy","would","be","1\/2","or",".5",".","Usage",":","``","`","python","acc","=","Accuracy","(",")","acc","(","torch.tensor","(","[","0",",","2",",","3",",","4","]",")",",","torch.tensor","(","[","1",",","2",",","3",",","4","]",")",")","assert","acc.compute","(",")","==","0.75","``","`"]
code: def __call__(self, preds, targets):
      preds, target = _unify_input_formats(preds, targets)
      self.correct += torch.sum(torch.eq(preds, targets))
      self.total += target.numel()
  
imports: import torch
  from abc import ABC, abstractmethod
label_desc: Use image node_id 2 for calling the Accuracy obj's underlying member method code with example usage: obj.__call__(preds, targets) without return types