code: def _gradient_matching_test_assert(
      self, model: Module, output_layer: Module, test_input: Tensor
  ) -> None:
      out = _forward_layer_eval(model, test_input, output_layer)
      # Select first element of tuple
      out = out[0]
      gradient_attrib = NeuronGradient(model, output_layer)
      self.assertFalse(gradient_attrib.multiplies_by_inputs)
      for i in range(cast(Tuple[int, ...], out.shape)[1]):
          neuron: Tuple[int, ...] = (i,)
          while len(neuron) < len(out.shape) - 1:
              neuron = neuron + (0,)
          input_attrib = Saliency(
              lambda x: _forward_layer_eval(
                  model, x, output_layer, grad_enabled=True
              )[0][(slice(None), *neuron)]
          )
          sal_vals = input_attrib.attribute(test_input, abs=False)
          grad_vals = gradient_attrib.attribute(test_input, neuron)
          # Verify matching sizes
          self.assertEqual(grad_vals.shape, sal_vals.shape)
          self.assertEqual(grad_vals.shape, test_input.shape)
          assertTensorAlmostEqual(
              self, sal_vals, grad_vals, delta=0.001, mode="max"
          )
  
imports: import unittest
  from typing import Any, Callable, cast, List, Tuple, Union
  import torch
  from captum._utils.gradient import _forward_layer_eval
  from captum._utils.typing import TensorOrTupleOfTensorsGeneric
  from captum.attr._core.neuron.neuron_gradient import NeuronGradient
  from captum.attr._core.saliency import Saliency
  from tests.helpers.basic import assertTensorAlmostEqual, assertTensorTuplesAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel_ConvNet, BasicModel_MultiLayer, BasicModel_MultiLayer_MultiInput
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 14 for calling the Test obj's underlying member method code with example usage: obj._gradient_matching_test_assert(model, output_layer, test_input) without return types