code: def test_requires_grad(self):
      result = self._metric.process(self._state)
      self.assertTrue(
          self._state[torchbearer.Y_PRED].requires_grad is True
      )
      self.assertTrue(result.requires_grad is False)
  
imports: import unittest
  from mock import Mock, MagicMock, create_autospec, patch
  import torch
  import torchbearer
  from torchbearer.bases import Metric, Callback, base_closure
  from torchbearer.metrics.primitives import CategoricalAccuracy
label_desc: Use image node_id 2 for calling the TestMetric obj's underlying member method code with example usage: obj.test_requires_grad() without return types