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"]
code: def _check_params(self) -> None:
      if self.min_tr < 0 or self.min_tr > 1:
          raise ValueError("min_tr must be between 0 and 1.")
  
      if self.num_xforms < 0 or not isinstance(self.num_xforms, int):
          raise ValueError("num_xforms must be non-negative integer.")
  
      if self.step_size <= 0:
          raise ValueError("step size must be positive.")
  
      if self.steps <= 0 or not isinstance(self.steps, int):
          raise ValueError("steps must be a positive integer.")
  
      if self.first_steps <= 0 or not isinstance(self.first_steps, int):
          raise ValueError("first_steps must be a positive integer.")
  
      if self.patch_removal_size <= 0:
          raise ValueError("patch_removal_size must be positive.")
  
      if self.patch_removal_interval <= 0:
          raise ValueError("patch_removal_interval must be positive.")
  
      if self.num_patches_to_remove <= 0 or not isinstance(
          self.num_patches_to_remove, int
      ):
          raise ValueError(
              "num_patches_to_remove must be a positive integer."
          )
  
      if (
          self.rotation_range[0] <= -90
          or self.rotation_range[1] >= 90
          or self.rotation_range[1] < self.rotation_range[0]
      ):
          raise ValueError("rotation range must be within (-90, 90).")
  
      if (
          self.dist_range[1] < self.dist_range[0]
          or self.dist_range[0] < 0
      ):
          raise ValueError(
              "distance range invalid. max must be greater than min, and must be nonnegative."
          )
  
      if (
          self.gamma_range[1] < self.gamma_range[0]
          or self.gamma_range[0] < 1
      ):
          raise ValueError(
              "gamma range max must be greater than min and the range must be at 1.0 or greater."
          )
  
      if self.crop_percent_range[1] < self.crop_percent_range[0]:
          raise ValueError(
              "max of crop percent range must be greater or equal to the min."
          )
  
      if self.off_x_range[1] < self.off_x_range[0]:
          raise ValueError(
              "max of off x range must be greater or equal to the min."
          )
  
      if self.off_y_range[1] < self.off_y_range[0]:
          raise ValueError(
              "max of off y range must be greater or equal to the min."
          )
  
      if min(self.blur_kernels) < 0:
          raise ValueError("blur kernels must be positive.")
  
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 5 for calling the GRAPHITEWhiteboxPyTorch obj's underlying member method code with example usage: obj._check_params() without return types