code: def _assert_attribution_delta(
      test: BaseTest,
      inputs: Union[Tensor, Tuple[Tensor, ...]],
      attributions: Union[Tensor, Tuple[Tensor, ...]],
      n_samples: int,
      delta: Tensor,
      delta_thresh: Union[float, Tensor] = 0.0006,
      is_layer: bool = False,
  ) -> None:
      if not is_layer:
          for input, attribution in zip(inputs, attributions):
              test.assertEqual(attribution.shape, input.shape)
      if isinstance(inputs, tuple):
          bsz = inputs[0].shape[0]
      else:
          bsz = inputs.shape[0]
      test.assertEqual([bsz * n_samples], list(delta.shape))
  
      delta = torch.mean(delta.reshape(bsz, -1), dim=1)
      _assert_delta(test, delta, delta_thresh)
  
file_path: captum/tests/attr/test_gradient_shap.py
imports: from typing import cast, Tuple, Union
  import numpy
  import torch
  from captum._utils.typing import Tensor
  from captum.attr._core.gradient_shap import GradientShap
  from captum.attr._core.integrated_gradients import IntegratedGradients
  from numpy import ndarray
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicLinearModel, BasicModel2
  from tests.helpers.classification_models import SoftmaxModel
label_desc: Use image node_id 1 for calling a global function with example usage: _assert_attribution_delta(test, inputs, attributions, n_samples, delta, delta_thresh, is_layer) without return types