class_docstr: Calculates how often predictions matches labels.
  
  For example, if `y_true` is tensor([1, 1, 0, 0]) and `y_pred` is tensor([0.98, 1, 0, 0.6])
  then the binary accuracy is 3/4 or .75.  If the weights were specified as
  [1, 0, 0, 1] then the binary accuracy would be 1/2 or .5.
  
  Usage:
  
  ```python
  target = torch.tensor([1, 1, 0, 0])
  pred = torch.tensor([0.98, 1, 0, 0.6])
  bac = BinaryAccuracy()
  bac(pred, target)
  assert bac.compute() == 0.75
  ```
class_docstr_tok: ["Calculates","how","often","predictions","matches","labels",".","For","example",",","if","`","y_true","`","is","tensor","(","[","1",",","1",",","0",",","0","]",")","and","`","y_pred","`","is","tensor","(","[","0.98",",","1",",","0",",","0.6","]",")","then","the","binary","accuracy","is","3\/4","or",".75",".","If","the","weights","were","specified","as","[","1",",","0",",","0",",","1","]","then","the","binary","accuracy","would","be","1\/2","or",".5",".","Usage",":","``","`","python","target","=","torch.tensor","(","[","1",",","1",",","0",",","0","]",")","pred","=","torch.tensor","(","[","0.98",",","1",",","0",",","0.6","]",")","bac","=","BinaryAccuracy","(",")","bac","(","pred",",","target",")","assert","bac.compute","(",")","==","0.75","``","`"]
code: def __init__(self):
      self.total = torch.tensor(0)
      self.correct = torch.tensor(0)
  
imports: import torch
  from abc import ABC, abstractmethod
label_desc: Use image node_id 1 to create a new BinaryAccuracy object from inherited base classes: PytorchMetric with example: obj = BinaryAccuracy()