code: def _margin_logit_loss(logits, labels):
      """
      Computes difference between logits for `labels` and next highest logits.
  
      The loss is high when `label` is unlikely (targeted by default).
      """
  
      correct_logits = logits.gather(1, labels[:, None]).squeeze(1)
  
      logit_indices = torch.arange(
          logits.size()[1],
          dtype=labels.dtype,
          device=labels.device,
      )[None, :].expand(labels.size()[0], -1)
      incorrect_logits = torch.where(
          logit_indices == labels[:, None],
          torch.full_like(logits, float("-inf")),
          logits,
      )
      max_incorrect_logits, _ = torch.max(incorrect_logits, 1)
  
      return max_incorrect_logits - correct_logits
  
file_path: cleverhans/cleverhans/torch/attacks/spsa.py
imports: import numpy
  import torch
  from torch import optim
  from cleverhans.torch.utils import clip_eta
label_desc: Use image node_id 4 for calling a global function with example usage: _margin_logit_loss(logits, labels) and returns: unknown