class_docstr: LBFGS is the first adversarial attack for convolutional neural networks,
  and is a target & iterative attack.
  Paper link: "https://arxiv.org/pdf/1312.6199.pdf"
  :param model: cleverhans.model.Model
  :param sess: tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor
docstr: Return a tensor that constructs adversarial examples for the given
  input. Generate uses tf.py_func in order to operate over tensors.
  :param x: (required) A tensor with the inputs.
  :param kwargs: See `parse_params`
docstr_tok: ["Return","a","tensor","that","constructs","adversarial","examples","for","the","given","input",".","Generate","uses","tf.py_func","in","order","to","operate","over","tensors",".",":","param","x",":","(","required",")","A","tensor","with","the","inputs",".",":","param","kwargs",":","See","`","parse_params","`"]
code: def generate(self, x, **kwargs):
      """
      Return a tensor that constructs adversarial examples for the given
      input. Generate uses tf.py_func in order to operate over tensors.
      :param x: (required) A tensor with the inputs.
      :param kwargs: See `parse_params`
      """
      assert (
          self.sess is not None
      ), "Cannot use `generate` when no `sess` was provided"
      self.parse_params(**kwargs)
  
      if self.y_target is None:
          self.y_target, nb_classes = self.get_or_guess_labels(
              x, kwargs
          )
          self.targeted_attack = False
      else:
          _, nb_classes = self.get_or_guess_labels(x, kwargs)
          self.targeted_attack = True
  
      attack = LBFGS_impl(
          self.sess,
          x,
          self.model.get_logits(x),
          self.y_target,
          self.targeted_attack,
          self.binary_search_steps,
          self.max_iterations,
          self.initial_const,
          self.clip_min,
          self.clip_max,
          nb_classes,
          self.batch_size,
      )
  
      def lbfgs_wrap(x_val, y_val):
          """
          Wrapper creating TensorFlow interface for use with py_func
          """
          return np.array(
              attack.attack(x_val, y_val), dtype=self.np_dtype
          )
  
      wrap = tf.py_func(lbfgs_wrap, [x, self.y_target], self.tf_dtype)
      wrap.set_shape(x.get_shape())
  
      return wrap
  
file_path: cleverhans/cleverhans_v3.1.0/cleverhans/attacks/lbfgs.py
imports: import numpy
  import tensorflow
  from cleverhans.attacks.attack import Attack
  from cleverhans.compat import reduce_sum, softmax_cross_entropy_with_logits
  from cleverhans.model import CallableModelWrapper, Model, wrapper_warning
  from cleverhans import utils
  from cleverhans import utils_tf
label_desc: Use image node_id 2 for calling the LBFGS obj's underlying member method code with example usage: obj.generate(x) and returns: wrap, np