class_docstr: Adversarially chosen rotations and translations. [#Engs]
  This implementation is based on the reference implementation by
  Madry et al.: https://github.com/MadryLab/adversarial_spatial
  
  References:
  .. [#Engs] Logan Engstrom*, Brandon Tran*, Dimitris Tsipras*,
         Ludwig Schmidt, Aleksander Mądry: "A Rotation and a
         Translation Suffice: Fooling CNNs with Simple Transformations",
         http://arxiv.org/abs/1712.02779
class_docstr_tok: ["Adversarially","chosen","rotations","and","translations",".","[","#","Engs","]","This","implementation","is","based","on","the","reference","implementation","by","Madry","et","al",".",":","https",":","\/\/github.com\/MadryLab\/adversarial_spatial","References",":","..","[","#","Engs","]","Logan","Engstrom","*",",","Brandon","Tran","*",",","Dimitris","Tsipras","*",",","Ludwig","Schmidt",",","Aleksander","M\u0105dry",":","``","A","Rotation","and","a","Translation","Suffice",":","Fooling","CNNs","with","Simple","Transformations","''",",","http",":","\/\/arxiv.org\/abs\/1712.02779"]
code: def __call__(  # type: ignore
      self,
      model: Model,
      inputs: T,
      criterion: Any,
      **kwargs: Any,
  ) -> Tuple[T, T, T]:
      x, restore_type = ep.astensor_(inputs)
      del inputs
      criterion = get_criterion(criterion)
  
      is_adversarial = get_is_adversarial(criterion, model)
  
      if x.ndim != 4:
          raise NotImplementedError(
              "only implemented for inputs with two spatial dimensions (and one channel and one batch dimension)"
          )
  
      xp = self.run(model, x, criterion)
      success = is_adversarial(xp)
  
      xp_ = restore_type(xp)
      return xp_, xp_, restore_type(success)
  
file_path: foolbox/foolbox/attacks/spatial_attack.py
imports: from typing import Union, Any, Tuple, Generator
  import eagerpy
  import numpy
  from ..devutils import atleast_kd
  from ..criteria import Criterion
  from .base import Model
  from .base import T
  from .base import get_is_adversarial
  from .base import get_criterion
  from .base import Attack
  from .spatial_attack_transformations import rotate_and_shift
  from .base import raise_if_kwargs
  from .base import verify_input_bounds
label_desc: Use image node_id 2 for calling the SpatialAttack obj's underlying member method code with example usage: obj.__call__(model, inputs, criterion) and returns: xp_,  xp_,  restore_type