code: def _assert_attribution(
      self, attribution: Tensor, expected: Tensor
  ) -> None:
      expected = torch.abs(expected)
      if len(attribution.shape) == 0:
          assert (attribution - expected).abs() < 0.001
      else:
          assertTensorAlmostEqual(
              self, expected, attribution, delta=0.5, mode="max"
          )
  
imports: from typing import Any, cast, Tuple, Union
  import torch
  from captum._utils.gradient import compute_gradients
  from captum._utils.typing import TensorOrTupleOfTensorsGeneric
  from captum.attr._core.noise_tunnel import NoiseTunnel
  from captum.attr._core.saliency import Saliency
  from tests.helpers.basic import assertTensorAlmostEqual, assertTensorTuplesAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel, BasicModel5_MultiArgs
  from tests.helpers.classification_models import SoftmaxModel
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 16 for calling the Test obj's underlying member method code with example usage: obj._assert_attribution(attribution, expected) without return types