code: def test_train(self):
      self._metric.train()
      calls = [
          [torch.FloatTensor([0.0]), torch.LongTensor([0])],
          [
              torch.FloatTensor([0.0, 0.1, 0.2, 0.3]),
              torch.LongTensor([0, 1, 2, 3]),
          ],
      ]
      for i in range(len(self._states)):
          self._metric.process(self._states[i])
      self.assertEqual(2, len(self._metric_function.call_args_list))
      for i in range(len(self._metric_function.call_args_list)):
          self.assertTrue(
              torch.eq(
                  self._metric_function.call_args_list[i][0][0],
                  calls[i][0],
              ).all
          )
          self.assertTrue(
              torch.lt(
                  torch.abs(
                      torch.add(
                          self._metric_function.call_args_list[i][0][1],
                          -calls[i][1],
                      )
                  ),
                  1e-12,
              ).all
          )
      self._metric_function.reset_mock()
      self._metric.process_final({})
  
      self.assertEqual(self._metric_function.call_count, 1)
      self.assertTrue(
          torch.eq(
              self._metric_function.call_args_list[0][0][1],
              torch.LongTensor([0, 1, 2, 3, 4]),
          ).all
      )
      self.assertTrue(
          torch.lt(
              torch.abs(
                  torch.add(
                      self._metric_function.call_args_list[0][0][0],
                      -torch.FloatTensor([0.0, 0.1, 0.2, 0.3, 0.4]),
                  )
              ),
              1e-12,
          ).all
      )
  
imports: import unittest
  import torch
  from mock import Mock, call
  from torch.autograd import Variable
  import torchbearer
  from torchbearer.metrics import Metric, BatchLambda, EpochLambda, ToDict
label_desc: Use image node_id 2 for calling the TestEpochLambda obj's underlying member method code with example usage: obj.test_train() without return types