class_docstr: Pairwise likelihood using logistic (i.e., sigmoid) function
  
  Given two items v and u with utilities f(v) and f(u), the probability that we
  prefer v over u with probability sigmoid(f(v) - f(u)). Note
  that this formulation implicitly assume the beta term in logistic function is
  fixed at 1.
code: def negative_log_gradient_sum(
      self, utility: Tensor, D: Tensor
  ) -> Tensor:
      indices_shape = utility.shape[:-1] + (-1,)
      winner_indices = (
          (D == 1).nonzero(as_tuple=True)[-1].reshape(indices_shape)
      )
      loser_indices = (
          (D == -1).nonzero(as_tuple=True)[-1].reshape(indices_shape)
      )
      ex = torch.exp(torch.gather(utility, -1, winner_indices))
      ey = torch.exp(torch.gather(utility, -1, loser_indices))
      unsigned_grad = ey / (ex + ey)
      grad = (unsigned_grad.unsqueeze(-2) @ (-D)).squeeze(-2)
      return grad
  
imports: from __future__ import annotations
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Tuple
  import torch
  from botorch.utils.probability.utils import log_ndtr, log_phi, standard_normal_log_hazard
  from gpytorch.likelihoods import Likelihood
  from torch import Tensor
  from torch.distributions import Bernoulli
label_desc: Use image node_id 4 for calling the PairwiseLogitLikelihood obj's underlying member method code with example usage: obj.negative_log_gradient_sum(utility, D) and returns: grad