class_docstr: Single Pixel Attack
  Algorithm 1 in https://arxiv.org/pdf/1612.06299.pdf
  
  :param predict: forward pass function.
  :param max_pixels: max number of pixels to perturb.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param loss_fn: loss function
  :param targeted: if the attack is targeted.
code: def perturb_single(self, x, y):
      # x shape [C * H * W]
      if self.comply_with_foolbox is True:
          np.random.seed(233333)
          rand_np = np.random.permutation(x.shape[1] * x.shape[2])
          pixels = torch.from_numpy(rand_np).type(torch.LongTensor)
      else:
          pixels = torch.randperm(x.shape[1] * x.shape[2])
      pixels = pixels.to(x.device)
      pixels = pixels[: self.max_pixels]
      for ii in range(self.max_pixels):
          row = pixels[ii] % x.shape[2]
          col = pixels[ii] // x.shape[2]
          for val in [self.clip_min, self.clip_max]:
              adv = replicate_input(x)
              for mm in range(x.shape[0]):
                  adv[mm, row, col] = val
              out_label = self._get_predicted_label(adv.unsqueeze(0))
              if self.targeted is True:
                  if int(out_label[0]) == int(y):
                      return adv
              else:
                  if int(out_label[0]) != int(y):
                      return adv
      return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import torch
  import torch.nn
  from advertorch.utils import clamp
  from advertorch.utils import replicate_input
  from .base import Attack
  from .base import LabelMixin
  from .utils import is_successful
label_desc: Use image node_id 2 for calling the SinglePixelAttack obj's underlying member method code with example usage: obj.perturb_single(x, y) and returns: x, adv, adv