code: def test_ignore_index(self):
      metric = TopKCategoricalAccuracy(
          ignore_index=1
      ).root  # Get root node of Tree for testing
      targets = [1, 1, 0, 0]
  
      metric.train()
      result = metric.process(self._state)
      for i in range(0, len(targets)):
          self.assertEqual(
              result[i],
              targets[i],
              msg="returned: "
              + str(result[i])
              + " expected: "
              + str(targets[i])
              + " in: "
              + str(result),
          )
  
imports: import unittest
  import torch
  from torch.autograd import Variable
  import torchbearer
  from torchbearer.metrics import Loss, Epoch, CategoricalAccuracy, TopKCategoricalAccuracy, BinaryAccuracy, MeanSquaredError
label_desc: Use image node_id 2 for calling the TestTopKCategoricalAccuracy obj's underlying member method code with example usage: obj.test_ignore_index() without return types