code: def interpolate_plane(
      points: torch.Tensor,
      source: torch.Tensor,
      **kwargs,
  ) -> torch.Tensor:
      """
      Bilinearly interpolates values of source grids. The first dimension of points represents
      number of points and the second coordinates, for example ([[x0, y0], [x1, y1], ...]).
      The first dimension of argument source represents feature and ones after that the
      spatial dimension.
  
      Arguments:
          points: shape (n_grids, n_points, 2),
          source: tensor of shape (n_grids, features, width, height),
      Returns:
          interpolated tensor of shape (n_grids, n_points, features)
      """
      # permuting because torch.nn.functional.grid_sample works with
      # (features, height, width) and not
      # (features, width, height)
      source = source.permute(0, 1, 3, 2)
      points = points[:, :, None, :]
  
      out = F.grid_sample(
          grid=points,
          input=source,
          **kwargs,
      )
      return out[:, :, :, 0].permute(0, 2, 1)
  
file_path: pytorch3d/pytorch3d/implicitron/models/implicit_function/utils.py
imports: from typing import Callable, Optional
  import torch
  import torch.nn.functional
  from pytorch3d.common.compat import prod
  from pytorch3d.implicitron.models.renderer.base import ImplicitronRayBundle
  from pytorch3d.renderer import ray_bundle_to_ray_points
  from pytorch3d.renderer.cameras import CamerasBase
label_desc: Use image node_id 4 for calling a global function with example usage: interpolate_plane(points, source) and returns: out