Interpolation Functionals#

physicsnemo.nn.functional.interpolation(
query_points: Tensor,
context_grid: Tensor,
grid: List[Tuple[float, float, int]],
interpolation_type: str = 'smooth_step_2',
mem_speed_trade: bool = True,
) Tensor#

Interpolate values from a grid at query point locations.

Parameters:
  • query_points (torch.Tensor) – Points at which interpolation is to be performed.

  • context_grid (torch.Tensor) – Source grid from which values are interpolated.

  • grid (list[tuple[float, float, int]]) – Describes the grid’s range and resolution.

  • interpolation_type (str, optional) – Interpolation method name, by default "smooth_step_2".

  • mem_speed_trade (bool, optional) – Trade-off between memory usage and speed.

  • implementation ({"warp", "torch"} or None) – Implementation to use. When None, dispatch selects the available implementation.

Notes

TODO: torch is the default dispatch implementation for now. The Warp implementation will be promoted to the default after additional validation and testing.

Benchmarks (ASV)

Interpolation benchmark comparison