code: def test_attack_masked_loss_defined(self) -> None:
      model = BasicModel_MultiLayer()
      add_input = torch.tensor([[-1.0, 2.0, 2.0]])
      input = torch.tensor([[1.0, 6.0, -3.0]])
      mask = torch.tensor([[0, 1, 0]])
      labels = torch.tensor([0])
      loss_func = CrossEntropyLoss(reduction="none")
      adv = PGD(model, loss_func)
      perturbed_input = adv.perturb(
          input,
          0.25,
          0.1,
          3,
          labels,
          additional_forward_args=(add_input,),
          mask=mask,
      )
      assertTensorAlmostEqual(
          self,
          perturbed_input,
          [[1.0, 6.0, -3.0]],
          delta=0.01,
          mode="max",
      )
  
file_path: captum/tests/robust/test_PGD.py
imports: import torch
  from captum.robust import PGD
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel, BasicModel2, BasicModel_MultiLayer
  from torch.nn import CrossEntropyLoss
label_desc: Use image node_id 13 for calling the Test obj's underlying member method code with example usage: obj.test_attack_masked_loss_defined() without return types