class_docstr: This class implements the `SquareAttack` attack.
  
  | Paper link: https://arxiv.org/abs/1912.00049
class_docstr_tok: ["This","class","implements","the","`","SquareAttack","`","attack",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/1912.00049"]
code: def _get_logits_diff(
      self, x: np.ndarray, y: np.ndarray
  ) -> np.ndarray:
      y_pred = self.estimator.predict(x, batch_size=self.batch_size)
  
      logit_correct = np.take_along_axis(
          y_pred, np.expand_dims(np.argmax(y, axis=1), axis=1), axis=1
      )
      logit_highest_incorrect = np.take_along_axis(
          y_pred,
          np.expand_dims(np.argsort(y_pred, axis=1)[:, -2], axis=1),
          axis=1,
      )
  
      return (logit_correct - logit_highest_incorrect)[:, 0]
  
file_path: adversarial-robustness-toolbox/art/attacks/evasion/square_attack.py
imports: import bisect
  import logging
  import math
  import random
  from typing import Optional, Union, Callable, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import check_and_transform_label_format, get_labels_np_array
label_desc: Use image node_id 2 for calling the SquareAttack obj's underlying member method code with example usage: obj._get_logits_diff(x, y) and returns: unknown