code: def NDCGridRaysampler(
      image_width: int,
      image_height: int,
      n_pts_per_ray: int,
      min_depth: float,
      max_depth: float,
  ) -> "NDCMultinomialRaysampler":
      """
      NDCGridRaysampler has been DEPRECATED. Use NDCMultinomialRaysampler instead.
      Preserving NDCGridRaysampler for backward compatibility.
      """
  
      warnings.warn(
          """NDCGridRaysampler is deprecated,
          Use NDCMultinomialRaysampler instead.
          NDCGridRaysampler will be removed in future releases.""",
          PendingDeprecationWarning,
      )
  
      return NDCMultinomialRaysampler(
          image_width=image_width,
          image_height=image_height,
          n_pts_per_ray=n_pts_per_ray,
          min_depth=min_depth,
          max_depth=max_depth,
      )
  
imports: import warnings
  from typing import Optional, Tuple, Union
  import torch
  from pytorch3d.common.compat import meshgrid_ij
  from pytorch3d.ops import padded_to_packed
  from pytorch3d.renderer.cameras import CamerasBase
  from pytorch3d.renderer.implicit.utils import HeterogeneousRayBundle, RayBundle
  from torch.nn import functional
label_desc: Use image node_id 2 for calling a global function with example usage: NDCGridRaysampler(image_width, image_height, n_pts_per_ray, min_depth, max_depth) and returns: NDCMultinomialRaysampler