class_docstr: This module contains an implementation of the Over-the-Air Adversarial Flickering attack on video recognition
  networks.
  
  | Paper link: https://arxiv.org/abs/2002.05123
class_docstr_tok: ["This","module","contains","an","implementation","of","the","Over-the-Air","Adversarial","Flickering","attack","on","video","recognition","networks",".","|","Paper","link",":","https",":","\/\/arxiv.org\/abs\/2002.05123"]
docstr: Generate a batch of adversarial samples and return them in an array.
  
  :param x: An array with the original inputs.
  :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)`.
  :return: Adversarial examples.
docstr_tok: ["Generate","a","batch","of","adversarial","samples","and","return","them","in","an","array",".",":","param","x",":","An","array","with","the","original","inputs",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","`","(","nb_samples",",","nb_classes",")","`",".",":","return",":","Adversarial","examples","."]
code: def _generate_batch(
      self, x: "torch.Tensor", y: "torch.Tensor"
  ) -> np.ndarray:
      """
      Generate a batch of adversarial samples and return them in an array.
  
      :param x: An array with the original inputs.
      :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)`.
      :return: Adversarial examples.
      """
      import torch
  
      x = x.to(self.estimator.device)
      y = y.to(self.estimator.device)
      x_adv = torch.clone(x)
  
      for _ in range(self.max_iter):
          x_adv = self._compute_torch(
              x_adv,
              x,
              y,
              self.eps_step,
          )
  
      return x_adv.cpu().detach().numpy()
  
imports: import logging
  from typing import Optional, TYPE_CHECKING
  import numpy
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.estimator import BaseEstimator
  from art.estimators.classification.classifier import ClassifierMixin, LossGradientsMixin
  from art.attacks.attack import EvasionAttack
  from art.utils import check_and_transform_label_format, get_labels_np_array
label_desc: Use image node_id 3 for calling the OverTheAirFlickeringPyTorch obj's underlying member method code with example usage: obj._generate_batch(x, y) and returns: x_adv