code: def test_multiple_layers_multiple_inputs_shared_input(self) -> None:
      input1 = torch.randn(5, 3)
      input2 = torch.randn(5, 3)
      input3 = torch.randn(5, 3)
      inputs = (input1, input2, input3)
      baseline = tuple(torch.zeros_like(inp) for inp in inputs)
  
      net = BasicModel_MultiLayer_TrueMultiInput()
  
      lig = LayerIntegratedGradients(net, layer=[net.m1, net.m234])
      ig = IntegratedGradients(net)
  
      # test layer inputs
      attribs_inputs = lig.attribute(
          inputs, baseline, target=0, attribute_to_layer_input=True
      )
      attribs_inputs_regular_ig = ig.attribute(
          inputs, baseline, target=0
      )
  
      self.assertIsInstance(attribs_inputs, list)
      self.assertEqual(len(attribs_inputs), 2)
      self.assertIsInstance(attribs_inputs[0], Tensor)
      self.assertIsInstance(attribs_inputs[1], tuple)
      self.assertEqual(len(attribs_inputs[1]), 3)
  
      assertTensorTuplesAlmostEqual(
          self,
          # last input for second layer is first input =>
          # add the attributions
          (attribs_inputs[0] + attribs_inputs[1][-1],)
          + attribs_inputs[1][0:-1],
          attribs_inputs_regular_ig,
          delta=1e-5,
      )
  
      # test layer outputs
      attribs = lig.attribute(inputs, baseline, target=0)
      ig = IntegratedGradients(lambda x, y: x + y)
      attribs_ig = ig.attribute(
          (net.m1(input1), net.m234(input2, input3, input1, 1)),
          (
              net.m1(baseline[0]),
              net.m234(baseline[1], baseline[2], baseline[1], 1),
          ),
          target=0,
      )
  
      assertTensorTuplesAlmostEqual(
          self, attribs, attribs_ig, delta=1e-5
      )
  
imports: from typing import Any, cast, List, Tuple, Union
  import torch
  from captum.attr._core.integrated_gradients import IntegratedGradients
  from captum.attr._core.layer.layer_activation import LayerActivation
  from captum.attr._core.layer.layer_conductance import LayerConductance
  from captum.attr._core.layer.layer_integrated_gradients import LayerIntegratedGradients
  from captum.attr._models.base import configure_interpretable_embedding_layer, remove_interpretable_embedding_layer
  from tests.helpers.basic import assertTensorAlmostEqual, assertTensorTuplesAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicEmbeddingModel, BasicModel_MultiLayer, BasicModel_MultiLayer_TrueMultiInput
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 8 for calling the Test obj's underlying member method code with example usage: obj.test_multiple_layers_multiple_inputs_shared_input() without return types