class_docstr: DeepFool is an untargeted & iterative attack which is based on an
  iterative linearization of the classifier. The implementation here
  is w.r.t. the L2 norm.
  Paper link: "https://arxiv.org/pdf/1511.04599.pdf"
  
  :param model: cleverhans.model.Model
  :param sess: tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor
docstr: Generate symbolic graph for adversarial examples and return.
  
  :param x: The model's symbolic inputs.
  :param kwargs: See `parse_params`
docstr_tok: ["Generate","symbolic","graph","for","adversarial","examples","and","return",".",":","param","x",":","The","model","'s","symbolic","inputs",".",":","param","kwargs",":","See","`","parse_params","`"]
code: def generate(self, x, **kwargs):
      """
      Generate symbolic graph for adversarial examples and return.
  
      :param x: The model's symbolic inputs.
      :param kwargs: See `parse_params`
      """
      assert (
          self.sess is not None
      ), "Cannot use `generate` when no `sess` was provided"
      from cleverhans.utils_tf import jacobian_graph
  
      # Parse and save attack-specific parameters
      assert self.parse_params(**kwargs)
  
      # Define graph wrt to this input placeholder
      logits = self.model.get_logits(x)
      self.nb_classes = logits.get_shape().as_list()[-1]
      assert (
          self.nb_candidate <= self.nb_classes
      ), "nb_candidate should not be greater than nb_classes"
      preds = tf.reshape(
          tf.nn.top_k(logits, k=self.nb_candidate)[0],
          [-1, self.nb_candidate],
      )
      # grads will be the shape [batch_size, nb_candidate, image_size]
      grads = tf.stack(
          jacobian_graph(preds, x, self.nb_candidate), axis=1
      )
  
      # Define graph
      def deepfool_wrap(x_val):
          """deepfool function for py_func"""
          return deepfool_batch(
              self.sess,
              x,
              preds,
              logits,
              grads,
              x_val,
              self.nb_candidate,
              self.overshoot,
              self.max_iter,
              self.clip_min,
              self.clip_max,
              self.nb_classes,
          )
  
      wrap = tf.py_func(deepfool_wrap, [x], self.tf_dtype)
      wrap.set_shape(x.get_shape())
      return wrap
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/deep_fool.py
imports: import copy
  import logging
  import warnings
  import numpy
  import tensorflow
  from cleverhans.attacks.attack import Attack
  from cleverhans.model import Model, wrapper_warning_logits, CallableModelWrapper
  from cleverhans import utils
  from cleverhans import utils_tf
label_desc: Use image node_id 2 for calling the DeepFool obj's underlying member method code with example usage: obj.generate(x) and returns: wrap, deepfool_batch