class_docstr: HopSkipJumpAttack was originally proposed by Chen, Jordan and Wainwright.
  It is a decision-based attack that requires access to output
  labels of a model alone.
  Paper link: https://arxiv.org/abs/1904.02144
  At a high level, this attack is an iterative attack composed of three
  steps: Binary search to approach the boundary; gradient estimation;
  stepsize search. HopSkipJumpAttack requires fewer model queries than
  Boundary Attack which was based on rejective sampling.
  :param model: cleverhans.model.Model
  :param sess: tf.Session
  :param dtypestr: dtype of the data
  :param kwargs: passed through to super constructor.
  see parse_params for details.
class_docstr_tok: ["HopSkipJumpAttack","was","originally","proposed","by","Chen",",","Jordan","and","Wainwright",".","It","is","a","decision-based","attack","that","requires","access","to","output","labels","of","a","model","alone",".","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1904.02144","At","a","high","level",",","this","attack","is","an","iterative","attack","composed","of","three","steps",":","Binary","search","to","approach","the","boundary",";","gradient","estimation",";","stepsize","search",".","HopSkipJumpAttack","requires","fewer","model","queries","than","Boundary","Attack","which","was","based","on","rejective","sampling",".",":","param","model",":","cleverhans.model.Model",":","param","sess",":","tf.Session",":","param","dtypestr",":","dtype","of","the","data",":","param","kwargs",":","passed","through","to","super","constructor",".","see","parse_params","for","details","."]
docstr: Generate adversarial images in a for loop.
  :param y: An array of shape (n, nb_classes) for true labels.
  :param y_target:  An array of shape (n, nb_classes) for target labels.
  Required for targeted attack.
  :param image_target: An array of shape (n, **image shape) for initial
  target images. Required for targeted attack.
  
  See parse_params for other kwargs.
docstr_tok: ["Generate","adversarial","images","in","a","for","loop",".",":","param","y",":","An","array","of","shape","(","n",",","nb_classes",")","for","true","labels",".",":","param","y_target",":","An","array","of","shape","(","n",",","nb_classes",")","for","target","labels",".","Required","for","targeted","attack",".",":","param","image_target",":","An","array","of","shape","(","n",",","*","*","image","shape",")","for","initial","target","images",".","Required","for","targeted","attack",".","See","parse_params","for","other","kwargs","."]
code: def generate_np(self, x, **kwargs):
      """
      Generate adversarial images in a for loop.
      :param y: An array of shape (n, nb_classes) for true labels.
      :param y_target:  An array of shape (n, nb_classes) for target labels.
      Required for targeted attack.
      :param image_target: An array of shape (n, **image shape) for initial
      target images. Required for targeted attack.
  
      See parse_params for other kwargs.
  
      """
  
      x_adv = []
  
      if (
          "image_target" in kwargs
          and kwargs["image_target"] is not None
      ):
          image_target = np.copy(kwargs["image_target"])
      else:
          image_target = None
      if "y_target" in kwargs and kwargs["y_target"] is not None:
          y_target = np.copy(kwargs["y_target"])
      else:
          y_target = None
  
      for i, x_single in enumerate(x):
          img = np.expand_dims(x_single, axis=0)
          if image_target is not None:
              single_img_target = np.expand_dims(
                  image_target[i], axis=0
              )
              kwargs["image_target"] = single_img_target
          if y_target is not None:
              single_y_target = np.expand_dims(y_target[i], axis=0)
              kwargs["y_target"] = single_y_target
  
          adv_img = super(HopSkipJumpAttack, self).generate_np(
              img, **kwargs
          )
          x_adv.append(adv_img)
  
      return np.concatenate(x_adv, axis=0)
  
imports: import logging
  import numpy
  import tensorflow
  from warnings import warn
  from cleverhans.attacks import Attack
  from cleverhans.model import CallableModelWrapper, Model, wrapper_warning_logits
  from cleverhans import utils, utils_tf
label_desc: Use image node_id 3 for calling the HopSkipJumpAttack obj's underlying member method code with example usage: obj.generate_np(x) and returns: np