class_docstr: Jacobian Saliency Map Attack
  This includes Algorithm 1 and 3 in v1, https://arxiv.org/abs/1511.07528v1
  
  :param predict: forward pass function.
  :param num_classes: number of clasess.
  :param clip_min: mininum value per input dimension.
  :param clip_max: maximum value per input dimension.
  :param gamma: highest percentage of pixels can be modified
  :param theta: perturb length, range is either [theta, 0], [0, theta]
class_docstr_tok: ["Jacobian","Saliency","Map","Attack","This","includes","Algorithm","1","and","3","in","v1",",","https",":","\/\/arxiv.org\/abs\/1511.07528v1",":","param","predict",":","forward","pass","function",".",":","param","num_classes",":","number","of","clasess",".",":","param","clip_min",":","mininum","value","per","input","dimension",".",":","param","clip_max",":","maximum","value","per","input","dimension",".",":","param","gamma",":","highest","percentage","of","pixels","can","be","modified",":","param","theta",":","perturb","length",",","range","is","either","[","theta",",","0","]",",","[","0",",","theta","]"]
code: def _saliency_map(self, search_space, grads_target, grads_other, y):
      dim_x = search_space.shape[1]
  
      # alpha in Algorithm 3 line 2
      gradsum_target = self._sum_pair(grads_target, dim_x)
      # alpha in Algorithm 3 line 3
      gradsum_other = self._sum_pair(grads_other, dim_x)
  
      if self.theta > 0:
          scores_mask = torch.gt(gradsum_target, 0) & torch.lt(
              gradsum_other, 0
          )
      else:
          scores_mask = torch.lt(gradsum_target, 0) & torch.gt(
              gradsum_other, 0
          )
  
      scores_mask &= self._and_pair(search_space.ne(0), dim_x)
      scores_mask[:, range(dim_x), range(dim_x)] = 0
  
      if self.comply_cleverhans:
          valid = torch.ones(scores_mask.shape[0]).byte()
      else:
          valid = scores_mask.view(-1, dim_x * dim_x).any(dim=1)
  
      scores = scores_mask.float() * (-gradsum_target * gradsum_other)
      best = torch.max(scores.view(-1, dim_x * dim_x), 1)[1]
      p1 = torch.remainder(best, dim_x)
      p2 = (best / dim_x).long()
      return p1, p2, valid
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import numpy
  import torch
  from advertorch.utils import clamp
  from advertorch.utils import jacobian
  from .base import Attack
  from .base import LabelMixin
label_desc: Use image node_id 5 for calling the JacobianSaliencyMapAttack obj's underlying member method code with example usage: obj._saliency_map(search_space, grads_target, grads_other, y) and returns: p1,  p2,  valid