def _generate_batch(self, x_batch: np.ndarray) -> np.ndarray:
        """
        Run the attack on a batch of images.

        :param x_batch: A batch of original examples.
        :return: A batch of adversarial examples.
        """

        import torch

        x_org = torch.from_numpy(x_batch).to(self.estimator.device)
        x_adv = x_org.clone()

        cond = torch.logical_or(x_org < 0.0, x_org > 1.0)
        if torch.any(cond):
            raise ValueError("The value of each pixel must be normalized in the range [0, 1].")

        for _ in range(self.max_iter):
            x_adv = self._attack(x_adv, x_org)

        return x_adv.cpu().detach().numpy()

        Run the attack on a batch of images.

        :param x_batch: A batch of original examples.
        :return: A batch of adversarial examples.
        
art/attacks/evasion/overload/overload.py