class_docstr: Allows measuring model robustness for a given attack or set of attacks. This class
  can be used with any metric(s) as well as any set of attacks, either based on
  attacks / perturbations from captum.robust such as FGSM or PGD or external
  augmentation methods or perturbations such as torchvision transforms.
code: def _parse_and_update_results(
      self, batch_summarizers: Dict[str, Summarizer]
  ) -> Dict[str, Union[MetricResultType, Dict[str, MetricResultType]]]:
      results: Dict[
          str, Union[MetricResultType, Dict[str, MetricResultType]]
      ] = {
          ORIGINAL_KEY: self._format_summary(
              cast(
                  Union[Dict, List],
                  batch_summarizers[ORIGINAL_KEY].summary,
              )
          )["mean"]
      }
      self.summary_results[ORIGINAL_KEY].update(
          self.metric_aggregator(results[ORIGINAL_KEY])
      )
      for attack_key in self.attacks:
          attack = self.attacks[attack_key]
          attack_results = self._format_summary(
              cast(
                  Union[Dict, List],
                  batch_summarizers[attack.name].summary,
              )
          )
          results[attack.name] = attack_results
  
          if len(attack_results) == 1:
              key = next(iter(attack_results))
              if attack.name not in self.summary_results:
                  self.summary_results[attack.name] = Summarizer(
                      [stat() for stat in self.aggregate_stats]
                  )
              self.summary_results[attack.name].update(
                  self.metric_aggregator(attack_results[key])
              )
          else:
              for key in attack_results:
                  summary_key = f"{attack.name} {key.title()} Attempt"
                  if summary_key not in self.summary_results:
                      self.summary_results[summary_key] = Summarizer(
                          [stat() for stat in self.aggregate_stats]
                      )
                  self.summary_results[summary_key].update(
                      self.metric_aggregator(attack_results[key])
                  )
      return results
  
imports: import warnings
  from collections import namedtuple
  from typing import Any, Callable, cast, Dict, Generic, List, NamedTuple, Optional, Tuple, TypeVar, Union
  from captum._utils.common import _expand_additional_forward_args, _format_additional_forward_args, _reduce_list
  from captum.attr import Max, Mean, Min, Summarizer
  from captum.log import log_usage
  from captum.robust._core.perturbation import Perturbation
  from torch import Tensor
label_desc: Use image node_id 7 for calling the AttackComparator obj's underlying member method code with example usage: obj._parse_and_update_results(batch_summarizers) and returns: results