code: def _guided_grad_cam_test_assert(
      self,
      model: Module,
      target_layer: Module,
      test_input: TensorOrTupleOfTensorsGeneric,
      expected,
      additional_input: Any = None,
      interpolate_mode: str = "nearest",
      attribute_to_layer_input: bool = False,
  ) -> None:
      guided_gc = GuidedGradCam(model, target_layer)
      self.assertFalse(guided_gc.multiplies_by_inputs)
      attributions = guided_gc.attribute(
          test_input,
          target=0,
          additional_forward_args=additional_input,
          interpolate_mode=interpolate_mode,
          attribute_to_layer_input=attribute_to_layer_input,
      )
      if isinstance(test_input, tuple):
          for i in range(len(test_input)):
              assertTensorAlmostEqual(
                  self,
                  attributions[i],
                  expected[i],
                  delta=0.01,
              )
      else:
          assertTensorAlmostEqual(
              self,
              attributions,
              expected,
              delta=0.01,
          )
  
file_path: captum/tests/attr/test_guided_grad_cam.py
imports: import unittest
  from typing import Any
  import torch
  from captum._utils.typing import TensorOrTupleOfTensorsGeneric
  from captum.attr._core.guided_grad_cam import GuidedGradCam
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel_ConvNet_One_Conv
  from torch.nn import Module
label_desc: Use image node_id 7 for calling the Test obj's underlying member method code with example usage: obj._guided_grad_cam_test_assert(model, target_layer, test_input, expected, additional_input, interpolate_mode, attribute_to_layer_input) without return types