class_docstr: Class to manage spatial ray sampling.
  
  Args:
      min_depth: sampled rays minimal depth from cameras: float
      max_depth: sampled rays maximal depth from cameras: float
      ndc: convert ray parameters to normalized device coordinates: bool
      device: device for ray tensors: Union[str, torch.device]
docstr: Builds a dictionary of ray pixel points, by total number of rays as key. The dictionary groups rays by
  the total amount of rays, which allows the case of casting different number of rays from each scene camera.
  
  Args:
      points2d_as_flat_tensors: dictionary of pixel coordinates grouped by total number of rays:
        Dict[int, Points2D_FlatTensors]
  
  Returns:
      dictionary of Points2D objects that holds information on pixel 2d coordinates of each ray and the camera
        id it was casted by: Dict[int, Points2D]
docstr_tok: ["Builds","a","dictionary","of","ray","pixel","points",",","by","total","number","of","rays","as","key",".","The","dictionary","groups","rays","by","the","total","amount","of","rays",",","which","allows","the","case","of","casting","different","number","of","rays","from","each","scene","camera",".","Args",":","points2d_as_flat_tensors",":","dictionary","of","pixel","coordinates","grouped","by","total","number","of","rays",":","Dict","[","int",",","Points2D_FlatTensors","]","Returns",":","dictionary","of","Points2D","objects","that","holds","information","on","pixel","2d","coordinates","of","each","ray","and","the","camera","id","it","was","casted","by",":","Dict","[","int",",","Points2D","]"]
code: def _build_num_ray_dict_of_points2d(
      points2d_as_flat_tensors: Dict[int, Points2D_FlatTensors],
  ) -> Dict[int, Points2D]:
      r"""Builds a dictionary of ray pixel points, by total number of rays as key. The dictionary groups rays by
      the total amount of rays, which allows the case of casting different number of rays from each scene camera.
  
      Args:
          points2d_as_flat_tensors: dictionary of pixel coordinates grouped by total number of rays:
            Dict[int, Points2D_FlatTensors]
  
      Returns:
          dictionary of Points2D objects that holds information on pixel 2d coordinates of each ray and the camera
            id it was casted by: Dict[int, Points2D]
      """
      num_ray_dict_of_points2d: Dict[int, RaySampler.Points2D] = {}
      for (
          n,
          points2d_as_flat_tensor,
      ) in points2d_as_flat_tensors.items():
          num_cams = len(points2d_as_flat_tensor._camera_ids)
          points_2d = (
              torch.stack(
                  (
                      points2d_as_flat_tensor._x,
                      points2d_as_flat_tensor._y,
                  )
              )
              .permute(1, 0)
              .reshape(num_cams, -1, 2)
          )
          num_ray_dict_of_points2d[n] = RaySampler.Points2D(
              points_2d, points2d_as_flat_tensor._camera_ids
          )
      return num_ray_dict_of_points2d
  
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 11 for calling the RaySampler obj's underlying member method code with example usage: obj._build_num_ray_dict_of_points2d(points2d_as_flat_tensors) and returns: num_ray_dict_of_points2d