code: def test_torch_CategoricalAccuracy():
      from zoo.orca.learn.pytorch.pytorch_metrics import (
          CategoricalAccuracy,
      )
  
      pred = torch.tensor([[0.1, 0.9, 0.8], [0.05, 0.95, 0]])
      target = torch.tensor([[0, 0, 1], [0, 1, 0]])
      cacc = CategoricalAccuracy()
      cacc(pred, target)
      assert cacc.compute() == 0.5
      pred = torch.tensor([[0.1, 0.9, 0.8], [0.05, 0.95, 0]])
      target = torch.tensor([[0, 1, 0], [0, 1, 0]])
      cacc(pred, target)
      assert cacc.compute() == 0.75
  
file_path: analytics-zoo/pyzoo/test/zoo/orca/learn/test_metrics.py
imports: import torch
label_desc: Use image node_id 3 for calling a global function with example usage: test_torch_CategoricalAccuracy() without return types