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()

        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.
        
art/attacks/evasion/composite_adversarial_attack.py