class_docstr: The black-box zeroth-order optimization attack from Pin-Yu Chen et al. (2018). This attack is a variant of the
  C&W attack which uses ADAM coordinate descent to perform numerical estimation of gradients.
  
  | Paper link: https://arxiv.org/abs/1708.03999
class_docstr_tok: ["The","black-box","zeroth-order","optimization","attack","from","Pin-Yu","Chen","et","al",".","(","2018",")",".","This","attack","is","a","variant","of","the","C","&","W","attack","which","uses","ADAM","coordinate","descent","to","perform","numerical","estimation","of","gradients",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1708.03999"]
code: def _optimizer(
      self, x: np.ndarray, targets: np.ndarray, c_batch: np.ndarray
  ) -> np.ndarray:
      # Variation of input for computing loss, same as in original implementation
      coord_batch = np.repeat(
          self._current_noise, 2 * self.nb_parallel, axis=0
      )
      coord_batch = coord_batch.reshape(
          2 * self.nb_parallel * self._current_noise.shape[0], -1
      )
  
      # Sample indices to prioritize for optimization
      if self.use_importance and np.unique(self._sample_prob).size != 1:
          indices = (
              np.random.choice(
                  coord_batch.shape[-1] * x.shape[0],
                  self.nb_parallel * self._current_noise.shape[0],
                  replace=False,
                  p=self._sample_prob.flatten(),
              )
              % coord_batch.shape[-1]
          )
      else:
          try:
              indices = (
                  np.random.choice(
                      coord_batch.shape[-1] * x.shape[0],
                      self.nb_parallel * self._current_noise.shape[0],
                      replace=False,
                  )
                  % coord_batch.shape[-1]
              )
          except ValueError as error:  # pragma: no cover
              if (
                  "Cannot take a larger sample than population when 'replace=False'"
                  in str(error)
              ):
                  raise ValueError(
                      "Too many samples are requested for the random indices. Try to reduce the number of parallel"
                      "coordinate updates `nb_parallel`."
                  ) from error
  
              raise error
  
      # Create the batch of modifications to run
      for i in range(self.nb_parallel * self._current_noise.shape[0]):
          coord_batch[2 * i, indices[i]] += self.variable_h
          coord_batch[2 * i + 1, indices[i]] -= self.variable_h
  
      # Compute loss for all samples and coordinates, then optimize
      expanded_x = np.repeat(x, 2 * self.nb_parallel, axis=0).reshape(
          (-1,) + x.shape[1:]
      )
      expanded_targets = np.repeat(
          targets, 2 * self.nb_parallel, axis=0
      ).reshape((-1,) + targets.shape[1:])
      expanded_c = np.repeat(c_batch, 2 * self.nb_parallel)
      _, _, loss = self._loss(
          expanded_x,
          expanded_x + coord_batch.reshape(expanded_x.shape),
          expanded_targets,
          expanded_c,
      )
      if (
          self.adam_mean is not None
          and self.adam_var is not None
          and self.adam_epochs is not None
      ):
          self._current_noise = self._optimizer_adam_coordinate(
              loss,
              indices,
              self.adam_mean,
              self.adam_var,
              self._current_noise,
              self.learning_rate,
              self.adam_epochs,
              True,
          )
      else:
          raise ValueError(
              "Unexpected `None` in `adam_mean`, `adam_var` or `adam_epochs` detected."
          )
  
      if (
          self.use_importance
          and self._current_noise.shape[2] > self._init_size
      ):
          self._sample_prob = self._get_prob(
              self._current_noise
          ).flatten()
  
      return x + self._current_noise
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, Any, TYPE_CHECKING
  import numpy
  from scipy.ndimage import zoom
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import compute_success, get_labels_np_array, check_and_transform_label_format
label_desc: Use image node_id 8 for calling the ZooAttack obj's underlying member method code with example usage: obj._optimizer(x, targets, c_batch) and returns: unknown