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: Compute perturbation.
  
  :param x: Current adversarial examples.
  :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)`.
  :param perturbation: Currently accumulated perturbation
  :return: Perturbations.
docstr_tok: ["Compute","perturbation",".",":","param","x",":","Current","adversarial","examples",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","`","(","nb_samples",",","nb_classes",")","`",".",":","param","perturbation",":","Currently","accumulated","perturbation",":","return",":","Perturbations","."]
code: def _compute_perturbation(
      self,
      x: "torch.Tensor",
      y: "torch.Tensor",
      perturbation: "torch.Tensor",
  ) -> "torch.Tensor":
      """
      Compute perturbation.
  
      :param x: Current adversarial examples.
      :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)`.
      :param perturbation: Currently accumulated perturbation
      :return: Perturbations.
      """
      import torch
  
      # Get gradient wrt loss
      grad = self._get_loss_gradients(x, y, perturbation)
  
      grad = torch.repeat_interleave(
          torch.repeat_interleave(grad, x.shape[2], dim=2),
          x.shape[3],
          dim=3,
      )
  
      if self.start_frame_index is not None:
          full_grad = torch.zeros(
              x.shape, dtype=grad.dtype, device=grad.device
          )
          full_grad[
              :, self.start_frame_index : self.end_frame_index, :, :, :
          ] = grad[
              :, self.start_frame_index : self.end_frame_index, :, :, :
          ]
          grad = full_grad
  
      return grad
  
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 5 for calling the OverTheAirFlickeringPyTorch obj's underlying member method code with example usage: obj._compute_perturbation(x, y, perturbation) and returns: grad