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 _resize_image(
      self, x: np.ndarray, size_x: int, size_y: int, reset: bool = False
  ) -> np.ndarray:
      if not self.estimator.channels_first:
          dims = (x.shape[0], size_x, size_y, x.shape[-1])
      else:
          dims = (x.shape[0], x.shape[1], size_x, size_y)
      nb_vars = np.prod(dims).item()
  
      if reset:
          # Reset variables to original size and value
          if dims == x.shape:
              resized_x = x
              if x.shape == self._current_noise.shape:
                  self._current_noise.fill(0)
              else:
                  self._current_noise = np.zeros(
                      x.shape, dtype=ART_NUMPY_DTYPE
                  )
          else:
              resized_x = zoom(
                  x,
                  (
                      1,
                      dims[1] / x.shape[1],
                      dims[2] / x.shape[2],
                      dims[3] / x.shape[3],
                  ),
              )
              self._current_noise = np.zeros(
                  dims, dtype=ART_NUMPY_DTYPE
              )
          self._sample_prob = (
              np.ones(nb_vars, dtype=ART_NUMPY_DTYPE) / nb_vars
          )
      else:
          # Rescale variables and reset values
          resized_x = zoom(
              x,
              (
                  1,
                  dims[1] / x.shape[1],
                  dims[2] / x.shape[2],
                  dims[3] / x.shape[3],
              ),
          )
          self._sample_prob = self._get_prob(
              self._current_noise, double=True
          ).flatten()
          self._current_noise = np.zeros(dims, dtype=ART_NUMPY_DTYPE)
  
      # Reset Adam
      self._reset_adam(nb_vars)
  
      return resized_x
  
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 11 for calling the ZooAttack obj's underlying member method code with example usage: obj._resize_image(x, size_x, size_y, reset) and returns: resized_x