code: def interp(x: Tensor, xp: Tensor, fp: Tensor) -> Tensor:
      """One-dimensional linear interpolation for monotonically increasing sample points.
  
      Returns the one-dimensional piecewise linear interpolant to a function with
      given discrete data points :math:`(xp, fp)`, evaluated at :math:`x`.
  
      Adjusted version of this https://github.com/pytorch/pytorch/issues/50334#issuecomment-1000917964
  
      Args:
          x: the :math:`x`-coordinates at which to evaluate the interpolated values.
          xp: the :math:`x`-coordinates of the data points, must be increasing.
          fp: the :math:`y`-coordinates of the data points, same length as `xp`.
  
      Returns:
          the interpolated values, same size as `x`.
  
      """
      m = _safe_divide(fp[1:] - fp[:-1], xp[1:] - xp[:-1])
      b = fp[:-1] - (m * xp[:-1])
  
      indices = torch.sum(torch.ge(x[:, None], xp[None, :]), 1) - 1
      indices = torch.clamp(indices, 0, len(m) - 1)
  
      return m[indices] * x + b[indices]
  
file_path: torchmetrics/src/torchmetrics/utilities/compute.py
imports: from typing import Optional, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 9 for calling a global function with example usage: interp(x, xp, fp) and returns: unknown