code: def test_attack_comparator_basic(self) -> None:
      model = BasicModel()
      inp = torch.tensor([[2.0, -9.0, 9.0, 1.0, -3.0]])
      attack_comp = AttackComparator(
          forward_func=lambda x: model(x)
          + torch.tensor([[0.000001, 0.0, 0.0, 0.0, 0.0]]),
          metric=tuple_metric,
      )
      attack_comp.add_attack(
          drop_column_perturb,
          name="first_column_perturb",
          attack_kwargs={"column": 0},
      )
      attack_comp.add_attack(
          drop_column_perturb,
          name="last_column_perturb",
          attack_kwargs={"column": -1},
      )
      attack_comp.add_attack(
          FGSM(model),
          attack_kwargs={"epsilon": 0.5},
          additional_attack_arg_names=["target"],
      )
      batch_results = attack_comp.evaluate(
          inp, target=0, named_tuple=True
      )
      expected_first_results = {
          "Original": (1.0, 1.0),
          "first_column_perturb": {"mean": (0.0, 0.0)},
          "last_column_perturb": {"mean": (1.0, 1.0)},
          "FGSM": {"mean": (1.0, 1.0)},
      }
      self._compare_results(batch_results, expected_first_results)
  
      alt_inp = torch.tensor([[1.0, 2.0, -3.0, 4.0, -5.0]])
  
      second_batch_results = attack_comp.evaluate(
          alt_inp, target=4, named_tuple=True
      )
      expected_second_results = {
          "Original": (0.0, -5.0),
          "first_column_perturb": {"mean": (0.0, -5.0)},
          "last_column_perturb": {"mean": (0.0, 0.0)},
          "FGSM": {"mean": (0.0, -4.5)},
      }
      self._compare_results(
          second_batch_results, expected_second_results
      )
  
      expected_summary_results = {
          "Original": {"mean": (0.5, -2.0)},
          "first_column_perturb": {"mean": (0.0, -2.5)},
          "last_column_perturb": {"mean": (0.5, 0.5)},
          "FGSM": {"mean": (0.5, -1.75)},
      }
      self._compare_results(
          attack_comp.summary(), expected_summary_results
      )
  
imports: import collections
  from typing import List
  import torch
  from captum.robust import AttackComparator, FGSM
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
  from tests.helpers.basic_models import BasicModel, BasicModel_MultiLayer
  from torch import Tensor
label_desc: Use image node_id 1 for calling the Test obj's underlying member method code with example usage: obj.test_attack_comparator_basic() without return types