code: def test_accuracy_metric(num_batches):
      """Test accuracy metric for different reductions procedures."""
      acc_metric = AccuracyMetric()
      cumulated_acc, counts = 0, 0
  
      for i in range(num_batches):
          input = torch.randn(3, 5)
          target = torch.empty(3, dtype=torch.long).random_(5)
  
          acc_metric.compute_metric(y_pred=input, y_true=target)
          cumulated_acc += torch.sum(
              torch.argmax(input, dim=-1) == target
          )
          counts += len(target)
  
      expected_value = cumulated_acc / counts
      result = acc_metric.result()
      assert np.isclose(expected_value, result["accuracy"])
  
      acc_metric.reset()
      assert np.isclose(acc_metric.total, 0)
      assert np.isclose(acc_metric.count, 0)
  
imports: import numpy
  import pytest
  import torch
  import torch.nn
  from alibi.models.pytorch.metrics import AccuracyMetric, LossContainer
label_desc: Use image node_id 2 for calling a global function with example usage: test_accuracy_metric(num_batches) without return types