code: def test_jacobian_scores_single_vector_multilayer(self) -> None:
      model = BasicLinearModel_Multilayer(5, 2, 2)
      model.linear1.weight = nn.Parameter(
          torch.arange(0, 10).view(2, 5).float()
      )
      model.linear2.weight = nn.Parameter(
          torch.arange(0, 4).view(2, 2).float()
      )
  
      a = torch.ones(5).unsqueeze(0)
  
      grads = _compute_jacobian_wrt_params(model, (a,))
      assertTensorAlmostEqual(
          self, grads[0][0], torch.cat((2 * a, 4 * a))
      )
      assertTensorAlmostEqual(
          self, grads[1][0], torch.Tensor([[10, 35], [10, 35]])
      )
  
      grads = _compute_jacobian_wrt_params_with_sample_wise_trick(
          model, (a,)
      )
      assertTensorAlmostEqual(
          self, grads[0][0], torch.cat((2 * a, 4 * a))
      )
      assertTensorAlmostEqual(
          self, grads[1][0], torch.Tensor([[10, 35], [10, 35]])
      )
  
imports: import torch
  import torch.nn
  from captum._utils.gradient import _compute_jacobian_wrt_params, _compute_jacobian_wrt_params_with_sample_wise_trick
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicLinearModel2, BasicLinearModel_Multilayer
label_desc: Use image node_id 4 for calling the Test obj's underlying member method code with example usage: obj.test_jacobian_scores_single_vector_multilayer() without return types