


  >>>     @staticmethod
  >>>     @once_differentiable
  >>>     def backward(ctx, g1, g2):  # still need to accept g2
  >>>         x, idx = ctx.saved_tensors
  >>>         grad_input = torch.zeros_like(x)
  >>>         grad_input.index_add_(0, idx, g1)
  >>>         return grad_input



