code: def _interpolate_gather(array, x):
      """
      Like ``torch.gather(-1, array, x)`` but continuously indexes into the
      rightmost dim of an array, linearly interpolating between array values.
      """
      with torch.no_grad():
          x0 = x.floor().clamp(min=0, max=array.size(-1) - 2)
          x1 = x0 + 1
      f0 = _gather(array, -1, x0.long())
      f1 = _gather(array, -1, x1.long())
      return f0 * (x1 - x) + f1 * (x - x0)
  
imports: import functools
  import weakref
  from collections import namedtuple
  import torch
  from torch.distributions import constraints
  from pyro.distributions.util import broadcast_shape, is_validation_enabled
  from pyro.ops.special import safe_log
  from .torch_distribution import TorchDistribution
label_desc: Use image node_id 3 for calling a global function with example usage: _interpolate_gather(array, x) and returns: unknown