class_docstr: Implementation of the white-box PyTorch GRAPHITE attack from Feng et al. (2022). This is a physical attack
  that generates robust physical perturbations that can be applied as stickers.
  
  | Paper link: https://arxiv.org/abs/2002.07088
  | Original github link: https://github.com/ryan-feng/GRAPHITE
class_docstr_tok: ["Implementation","of","the","white-box","PyTorch","GRAPHITE","attack","from","Feng","et","al",".","(","2022",")",".","This","is","a","physical","attack","that","generates","robust","physical","perturbations","that","can","be","applied","as","stickers",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2002.07088","|","Original","github","link",":","https",":","\/\/github.com\/ryan-feng\/GRAPHITE"]
docstr: Compute transform-robustness.
  
  :param x: Original image.
  :param x_adv: Attacked image.
  :param mask: The mask.
  :param target_label: The target label.
  :param y_onehot: The target label in one hot form.
  :param xforms: Ths list of transformation parameters.
  :param clip_min: Minimum value of an example.
  :param clip_max: Maximum value of an example.
  :param pts: Optional. A set of points that will set the crop size in the perspective transform.
  :return: Transform-robustness of the attack.
docstr_tok: ["Compute","transform-robustness",".",":","param","x",":","Original","image",".",":","param","x_adv",":","Attacked","image",".",":","param","mask",":","The","mask",".",":","param","target_label",":","The","target","label",".",":","param","y_onehot",":","The","target","label","in","one","hot","form",".",":","param","xforms",":","Ths","list","of","transformation","parameters",".",":","param","clip_min",":","Minimum","value","of","an","example",".",":","param","clip_max",":","Maximum","value","of","an","example",".",":","param","pts",":","Optional",".","A","set","of","points","that","will","set","the","crop","size","in","the","perspective","transform",".",":","return",":","Transform-robustness","of","the","attack","."]
code: def _eval(
      self,
      x: "torch.Tensor",
      x_adv: "torch.Tensor",
      mask: "torch.Tensor",
      target_label: np.ndarray,
      y_onehot: "torch.Tensor",
      xforms: List[
          Tuple[
              float,
              float,
              float,
              int,
              float,
              float,
              float,
              float,
              float,
          ]
      ],
      clip_min: float,
      clip_max: float,
      pts: Optional[np.ndarray],
  ) -> float:
      """
      Compute transform-robustness.
  
      :param x: Original image.
      :param x_adv: Attacked image.
      :param mask: The mask.
      :param target_label: The target label.
      :param y_onehot: The target label in one hot form.
      :param xforms: Ths list of transformation parameters.
      :param clip_min: Minimum value of an example.
      :param clip_max: Maximum value of an example.
      :param pts: Optional. A set of points that will set the crop size in the perspective transform.
      :return: Transform-robustness of the attack.
      """
      import torch
  
      successes = 0
      for xform in xforms:
          with torch.no_grad():
              if len(x_adv.shape) == 3:
                  x_adv = x_adv.unsqueeze(0)
              transformed_x_adv = transform_wb(
                  x,
                  x_adv,
                  mask,
                  xform,
                  self.net_size,
                  clip_min,
                  clip_max,
                  pts,
              )
              (
                  logits,
                  _,
              ) = self.estimator._predict_framework(  # pylint: disable=W0212
                  transformed_x_adv.to(self.estimator.device), y_onehot
              )
              success = int(
                  logits.argmax(dim=1).detach().cpu().numpy()[0]
                  == target_label
              )
              successes += success
      return successes / len(xforms)
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/graphite/graphite_whitebox_pytorch.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, Union, TYPE_CHECKING, List
  import numpy
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification import ClassifierMixin
  from art.utils import compute_success, to_categorical, check_and_transform_label_format, is_probability
  from art.attacks.evasion.graphite.utils import convert_to_network, get_transform_params, transform_wb
label_desc: Use image node_id 3 for calling the GRAPHITEWhiteboxPyTorch obj's underlying member method code with example usage: obj._eval(x, x_adv, mask, target_label, y_onehot, xforms, clip_min, clip_max, pts) and returns: unknown