poplar.utilities ================ .. py:module:: poplar.utilities .. autoapi-nested-parse:: General utility functions. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: poplar.utilities.interpolate Module Contents --------------- .. py:function:: interpolate(x: torch.Tensor, xp: torch.Tensor, fp: torch.Tensor) -> torch.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`. From https://github.com/pytorch/pytorch/issues/50334#issuecomment-1247611276. :Parameters: **x** : torch.Tensor the :math:`x`-coordinates at which to evaluate the interpolated values. **xp** : torch.Tensor the :math:`x`-coordinates of the data points, must be increasing. **fp** : torch.Tensor the :math:`y`-coordinates of the data points, same length as `xp`. :Returns: torch.Tensor the interpolated values, same size as `x` .. !! processed by numpydoc !!