code: def sample_ray_points(
      origins: Tensor, directions: Tensor, lengths: Tensor
  ) -> (
      Tensor
  ):  # FIXME: Test by projecting to points_2d and compare with sampler 2d points
      r"""
      Args:
          origins: tensor containing ray origins in 3d world coordinates. Tensor shape :math:`(*, 3)`.
          directions: tensor containing ray directions in 3d world coordinates. Tensor shape :math:`(*, 3)`.
          lengths: tensor containing sampled distances along each ray. Tensor shape :math:`(*, num_ray_points)`.
  
      Returns:
          points_3d: Points along rays :math:`(*, num_ray_points, 3)`
      """
      points_3d = (
          origins[..., None, :]
          + lengths[..., None] * directions[..., None, :]
      )
      return points_3d
  
imports: import math
  from typing import Dict, List, Tuple
  import torch
  from kornia.core import Device, Tensor, tensor
  from kornia.geometry.camera import PinholeCamera
  from kornia.nerf.camera_utils import cameras_for_ids
  from kornia.utils._compat import torch_meshgrid
  from kornia.utils.helpers import _torch_inverse_cast
label_desc: Use image node_id 2 for calling a global function with example usage: sample_ray_points(origins, directions, lengths) and returns: points_3d