class_docstr: Implementation of the composite adversarial attack on image classifiers in PyTorch. The attack is constructed by
  adversarially perturbing the hue component of the inputs. It uses order scheduling to search for the attack sequence
  and uses the iterative gradient sign method to optimize the perturbations in semantic space and Lp-ball (see
  `FastGradientMethod` and `BasicIterativeMethod`).
  
  | Note that this attack is intended for only PyTorch image classifiers with RGB images in the range [0, 1] as inputs
  
  | Paper link: https://arxiv.org/abs/2202.04235
class_docstr_tok: ["Implementation","of","the","composite","adversarial","attack","on","image","classifiers","in","PyTorch",".","The","attack","is","constructed","by","adversarially","perturbing","the","hue","component","of","the","inputs",".","It","uses","order","scheduling","to","search","for","the","attack","sequence","and","uses","the","iterative","gradient","sign","method","to","optimize","the","perturbations","in","semantic","space","and","Lp-ball","(","see","`","FastGradientMethod","`","and","`","BasicIterativeMethod","`",")",".","|","Note","that","this","attack","is","intended","for","only","PyTorch","image","classifiers","with","RGB","images","in","the","range","[","0",",","1","]","as","inputs","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2202.04235"]
docstr: Generate a batch of composite adversarial examples and return them in a NumPy array.
  
  :param x: A tensor of a batch of original inputs to be attacked.
  :param y: A tensor of a batch of the original labels to be predicted.
  :return: An array holding the composite adversarial examples.
docstr_tok: ["Generate","a","batch","of","composite","adversarial","examples","and","return","them","in","a","NumPy","array",".",":","param","x",":","A","tensor","of","a","batch","of","original","inputs","to","be","attacked",".",":","param","y",":","A","tensor","of","a","batch","of","the","original","labels","to","be","predicted",".",":","return",":","An","array","holding","the","composite","adversarial","examples","."]
code: def _generate_batch(
      self, x: "torch.Tensor", y: "torch.Tensor"
  ) -> np.ndarray:
      """
      Generate a batch of composite adversarial examples and return them in a NumPy array.
  
      :param x: A tensor of a batch of original inputs to be attacked.
      :param y: A tensor of a batch of the original labels to be predicted.
      :return: An array holding the composite adversarial examples.
      """
      import torch
  
      self.batch_size = x.shape[0]
      self._setup_attack()
      self.is_attacked = torch.zeros(
          self.batch_size, device=self.device
      ).bool()
      self.is_not_attacked = torch.ones(
          self.batch_size, device=self.device
      ).bool()
      x, y = x.to(self.device), y.to(self.device)
  
      return self.caa_attack(x, y).cpu().detach().numpy()
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Optional, Tuple, List, TYPE_CHECKING
  import numpy
  from tqdm.auto import tqdm
  from art.attacks.attack import EvasionAttack
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.estimators.classification.classifier import ClassifierMixin
  from art.utils import compute_success, check_and_transform_label_format
label_desc: Use image node_id 5 for calling the CompositeAdversarialAttackPyTorch obj's underlying member method code with example usage: obj._generate_batch(x, y) and returns: self