code: def test_classification_infidelity_tpl_target_w_baseline(
      self,
  ) -> None:
      model = BasicModel_MultiLayer()
      input = torch.arange(1.0, 13.0).view(4, 3)
      baseline = torch.ones(4, 3)
      additional_forward_args = (
          torch.arange(1, 13).view(4, 3).float(),
          True,
      )
      targets: List = [(0, 1, 1), (0, 1, 1), (1, 1, 1), (0, 1, 1)]
      ig = IntegratedGradients(model)
  
      def perturbed_func2(inputs, baselines):
          return torch.ones(baselines.shape), baselines
  
      @infidelity_perturb_func_decorator(True)
      def perturbed_func3(inputs, baselines):
          return baselines
  
      attr, delta = ig.attribute(
          input,
          target=targets,
          additional_forward_args=additional_forward_args,
          baselines=baseline,
          return_convergence_delta=True,
      )
  
      infid = self.infidelity_assert(
          model,
          attr,
          input,
          torch.tensor([0.10686, 0.0, 0.0, 0.0]),
          additional_args=additional_forward_args,
          baselines=baseline,
          target=targets,
          multi_input=False,
          n_perturb_samples=3,
          perturb_func=perturbed_func3,
      )
  
      infid2 = self.infidelity_assert(
          model,
          attr,
          input,
          torch.tensor([0.10686, 0.0, 0.0, 0.0]),
          additional_args=additional_forward_args,
          baselines=baseline,
          target=targets,
          multi_input=False,
          n_perturb_samples=3,
          perturb_func=perturbed_func2,
      )
  
      assertTensorAlmostEqual(self, infid, delta * delta)
      assertTensorAlmostEqual(self, infid, infid2)
  
imports: import typing
  from typing import Any, Callable, cast, List, Tuple, Union
  import torch
  from captum._utils.typing import BaselineType, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr import Attribution, DeepLift, FeatureAblation, IntegratedGradients, Saliency
  from captum.metrics import infidelity, infidelity_perturb_func_decorator
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel2, BasicModel4_MultiArgs, BasicModel_ConvNet_One_Conv, BasicModel_MultiLayer
  from torch import Tensor
  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.test_classification_infidelity_tpl_target_w_baseline() and returns: torch,  baselines, baselines