code: def test_multi_input(self) -> None:
      batch_size = 20
      inp1_size = (5, 2)
      inp2_size = (5, 3)
  
      labels = torch.randn(batch_size)
  
      def forward_func(*x: Tensor) -> Tensor:
          y = torch.zeros(x[0].shape[0:2])
          for xx in x:
              y += xx[:, :, 0] * xx[:, :, 1]
          y = y.sum(dim=-1)
  
          return torch.mean((y - labels) ** 2)
  
      feature_importance = FeaturePermutation(forward_func=forward_func)
  
      inp = (
          torch.randn((batch_size,) + inp1_size),
          torch.randn((batch_size,) + inp2_size),
      )
  
      feature_mask = (
          torch.arange(inp[0][0].numel())
          .view_as(inp[0][0])
          .unsqueeze(0),
          torch.arange(inp[1][0].numel())
          .view_as(inp[1][0])
          .unsqueeze(0),
      )
  
      inp[1][:, :, 1] = 4
      attribs = feature_importance.attribute(
          inp, feature_mask=feature_mask
      )
  
      self.assertTrue(isinstance(attribs, tuple))
      self.assertTrue(len(attribs) == 2)
  
      self.assertTrue(attribs[0].squeeze(0).size() == inp1_size)
      self.assertTrue(attribs[1].squeeze(0).size() == inp2_size)
  
      self.assertTrue((attribs[1][:, :, 1] == 0).all())
      self.assertTrue((attribs[1][:, :, 2] == 0).all())
  
      self.assertTrue((attribs[0] != 0).all())
      self.assertTrue((attribs[1][:, :, 0] != 0).all())
  
file_path: captum/tests/attr/test_feature_permutation.py
imports: from typing import List, Tuple
  import torch
  from captum.attr._core.feature_permutation import _permute_feature, FeaturePermutation
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModelWithSparseInputs
  from torch import Tensor
label_desc: Use image node_id 6 for calling the Test obj's underlying member method code with example usage: obj.test_multi_input() and returns: torch