code: def forward_eval_layer_with_inputs_helper(
      self, model, inputs_to_test
  ):
      # hard coding for simplicity
      # 0 if using args, 1 if using kwargs
      #   => no 0s after first 1 (left to right)
      #
      # used to test utilization of args/kwargs
      use_args_or_kwargs = [
          [[0], [1]],
          [
              [0, 0],
              [0, 1],
              [1, 1],
          ],
      ]
  
      model = ModelInputWrapper(model)
  
      def forward_func(*args, args_or_kwargs=None):
          # convert to args or kwargs to test *args and **kwargs wrapping behavior
          new_args = []
          new_kwargs = {}
          for args_or_kwarg, name, inp in zip(
              args_or_kwargs, inputs_to_test.keys(), args
          ):
              if args_or_kwarg:
                  new_kwargs[name] = inp
              else:
                  new_args.append(inp)
          return model(*new_args, **new_kwargs)
  
      for args_or_kwargs in use_args_or_kwargs[len(inputs_to_test) - 1]:
          with self.subTest(args_or_kwargs=args_or_kwargs):
              inputs = _forward_layer_eval(
                  functools.partial(
                      forward_func, args_or_kwargs=args_or_kwargs
                  ),
                  inputs=tuple(inputs_to_test.values()),
                  layer=[
                      model.input_maps[name]
                      for name in inputs_to_test.keys()
                  ],
              )
  
              inputs_with_attrib_to_inp = _forward_layer_eval(
                  functools.partial(
                      forward_func, args_or_kwargs=args_or_kwargs
                  ),
                  inputs=tuple(inputs_to_test.values()),
                  layer=[
                      model.input_maps[name]
                      for name in inputs_to_test.keys()
                  ],
                  attribute_to_layer_input=True,
              )
  
              for i1, i2, i3 in zip(
                  inputs,
                  inputs_with_attrib_to_inp,
                  inputs_to_test.values(),
              ):
                  self.assertTrue((i1[0] == i2[0]).all())
                  self.assertTrue((i1[0] == i3).all())
  
file_path: captum/tests/attr/test_input_layer_wrapper.py
imports: import functools
  import inspect
  from typing import Callable, Dict, Tuple
  import torch
  from captum._utils.gradient import _forward_layer_eval
  from captum.attr import DeepLift, DeepLiftShap, FeatureAblation, GradientShap, InputXGradient, IntegratedGradients, LayerDeepLift, LayerDeepLiftShap, LayerFeatureAblation, LayerGradientShap, LayerGradientXActivation, LayerIntegratedGradients
  from captum.attr._utils.input_layer_wrapper import ModelInputWrapper
  from tests.helpers.basic import assertTensorTuplesAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel, BasicModel_MultiLayer_TrueMultiInput, MixedKwargsAndArgsModule
label_desc: Use image node_id 3 for calling the TestInputLayerWrapper obj's underlying member method code with example usage: obj.forward_eval_layer_with_inputs_helper(model, inputs_to_test) and returns: model