code: def test_torch_BinaryAccuracy():
      from zoo.orca.learn.pytorch.pytorch_metrics import BinaryAccuracy
  
      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
      target = torch.tensor([1, 1, 0, 0])
      pred = torch.tensor([0.98, 1, 0, 0.6])
      bac(pred, target, threshold=0.7)
      assert bac.compute() == 0.875
  
file_path: analytics-zoo/pyzoo/test/zoo/orca/learn/test_metrics.py
imports: import torch
label_desc: Use image node_id 2 for calling a global function with example usage: test_torch_BinaryAccuracy() without return types