code: def basic_model_assert(
      self,
      model: Module,
      inputs: TensorOrTupleOfTensorsGeneric,
      expected: Tensor,
      n_perturb_samples: int = 10,
      max_batch_size: int = None,
      perturb_func: Callable = _local_perturb_func,
      multiply_by_inputs: bool = False,
      normalize: bool = False,
  ) -> Tensor:
      ig = IntegratedGradients(model)
      if multiply_by_inputs:
          attrs = cast(
              TensorOrTupleOfTensorsGeneric,
              tuple(
                  attr / input
                  for input, attr in zip(inputs, ig.attribute(inputs))
              ),
          )
      else:
          attrs = ig.attribute(inputs)
  
      return self.infidelity_assert(
          model,
          attrs,
          inputs,
          expected,
          n_perturb_samples=n_perturb_samples,
          max_batch_size=max_batch_size,
          perturb_func=perturb_func,
          normalize=normalize,
      )
  
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 12 for calling the Test obj's underlying member method code with example usage: obj.basic_model_assert(model, inputs, expected, n_perturb_samples, max_batch_size, perturb_func, multiply_by_inputs, normalize) and returns: self