class_docstr: Class to manage random ray spatial sampling.
  
  Args:
      min_depth: sampled rays minimal depth from cameras: float
      max_depth: sampled rays maximal depth from cameras: float
      ndc: convert to normalized device coordinates: bool
      device: device for ray tensors: Union[str, torch.device]
docstr: Calculates ray parameters: origins, directions. Also stored are camera ids for each ray, and its pixel
  coordinates.
  
  Args:
      cameras: scene cameras: PinholeCamera
      num_img_rays: tensor that holds the number of rays to randomly cast from each scene camera: int math: `(B)`.
docstr_tok: ["Calculates","ray","parameters",":","origins",",","directions",".","Also","stored","are","camera","ids","for","each","ray",",","and","its","pixel","coordinates",".","Args",":","cameras",":","scene","cameras",":","PinholeCamera","num_img_rays",":","tensor","that","holds","the","number","of","rays","to","randomly","cast","from","each","scene","camera",":","int","math",":","`","(","B",")","`","."]
code: def calc_ray_params(
      self, cameras: PinholeCamera, num_img_rays: Tensor
  ) -> None:
      r"""Calculates ray parameters: origins, directions. Also stored are camera ids for each ray, and its pixel
      coordinates.
  
      Args:
          cameras: scene cameras: PinholeCamera
          num_img_rays: tensor that holds the number of rays to randomly cast from each scene camera: int math: `(B)`.
      """
      num_cams = cameras.batch_size
      if num_cams != num_img_rays.shape[0]:
          raise ValueError(
              f"Number of cameras {num_cams} does not match size of tensor to define number of rays to march from "
              f"each camera {num_img_rays.shape[0]}"
          )
      points_2d_camera = self.sample_points_2d(
          cameras.height, cameras.width, num_img_rays
      )
      self._calc_ray_params(cameras, points_2d_camera)
  
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 3 for calling the RandomRaySampler obj's underlying member method code with example usage: obj.calc_ray_params(cameras, num_img_rays) without return types