code: def test_torch_Accuracy():
      from bigdl.orca.learn.pytorch.pytorch_metrics import Accuracy
  
      pred = torch.tensor([0, 2, 3, 4])
      target = torch.tensor([1, 2, 3, 4])
      acc = Accuracy()
      acc(pred, target)
      assert acc.compute() == 0.75
      pred = torch.tensor([0, 2, 3, 4])
      target = torch.tensor([1, 1, 2, 4])
      acc(pred, target)
      assert acc.compute() == 0.5
  
file_path: BigDL/python/orca/test/bigdl/orca/learn/test_metrics.py
imports: import torch
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_torch_Accuracy() without return types