code: def test_bpda_nograd_on_multi_input(device, func):
      class MultiInputFunc(nn.Module):
          def forward(self, x, y):
              return 2.0 * x - 1.0 * y
  
      class DummyNet(nn.Module):
          def __init__(self):
              super(DummyNet, self).__init__()
              self.linear = nn.Linear(1200, 10)
  
          def forward(self, x):
              x = x.view(x.shape[0], -1)
              return self.linear(x)
  
      bpda = BPDAWrapper(forward=MultiInputFunc())
  
      with torch.enable_grad():
          x = torch.rand(
              size=(10, 3, 20, 20), device=device, requires_grad=True
          )
          y = torch.rand_like(x, requires_grad=True)
          z = bpda(x, y)
          z_ = z.detach().requires_grad_()
  
      net = nn.Sequential(func, DummyNet())
      net.to(device)
  
      with torch.enable_grad():
          loss_ = net(z_).sum()
          loss = net(z).sum()
      (grad_z,) = torch.autograd.grad(loss_, [z_])
      grad_x, grad_y = torch.autograd.grad(loss, [x, y])
  
      assert torch_allclose(grad_x, grad_z)
      assert torch_allclose(grad_y, grad_z)
  
file_path: advertorch/tests/test_bpda.py
imports: import itertools
  import pytest
  import torch
  import torch.nn
  from advertorch.bpda import BPDAWrapper
  from advertorch.utils import torch_allclose
  from advertorch.test_utils import withgrad_defenses
  from advertorch.test_utils import nograd_defenses
  from advertorch.test_utils import defense_kwargs
  from advertorch.test_utils import defense_data
  from advertorch.test_utils import vecdata
label_desc: Use image node_id 7 for calling a global function with example usage: test_bpda_nograd_on_multi_input(device, func) and returns: unknown, self