code: def test_torch_Top5Accuracy():
      from bigdl.orca.learn.pytorch.pytorch_metrics import Top5Accuracy
  
      pred = torch.tensor(
          [
              [0.1, 0.9, 0.8, 0.4, 0.5, 0.2],
              [0.05, 0.95, 0, 0.4, 0.5, 0.2],
          ]
      )
      target = torch.tensor([2, 2])
      top5acc = Top5Accuracy()
      top5acc(pred, target)
      assert top5acc.compute() == 0.5
      pred = torch.tensor(
          [
              [0.1, 0.9, 0.8, 0.4, 0.5, 0.2],
              [0.05, 0.95, 0, 0.4, 0.5, 0.2],
          ]
      )
      target = torch.tensor([[2], [1]])
      top5acc(pred, target)
      assert top5acc.compute() == 0.75
  
file_path: BigDL/python/orca/test/bigdl/orca/learn/test_metrics.py
imports: import torch
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_torch_Top5Accuracy() without return types