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: Adds x/y pixel coordinates for all rays casted by a scene camera to dictionary of pixel coordinates
  grouped by total number of rays.
docstr_tok: ["Adds","x\/y","pixel","coordinates","for","all","rays","casted","by","a","scene","camera","to","dictionary","of","pixel","coordinates","grouped","by","total","number","of","rays","."]
code: def _add_points2d_as_flat_tensors_to_num_ray_dict(
      n: int,
      x: Tensor,
      y: Tensor,
      camera_id: int,
      points2d_as_flat_tensors: Dict[int, Points2D_FlatTensors],
  ) -> None:
      r"""Adds x/y pixel coordinates for all rays casted by a scene camera to dictionary of pixel coordinates
      grouped by total number of rays."""
      if n not in points2d_as_flat_tensors:
          points2d_as_flat_tensors[
              n
          ] = RaySampler.Points2D_FlatTensors()
          points2d_as_flat_tensors[n]._x = x.flatten()
          points2d_as_flat_tensors[n]._y = y.flatten()
      else:
          points2d_as_flat_tensors[n]._x = torch.cat(
              (points2d_as_flat_tensors[n]._x, x.flatten())
          )
          points2d_as_flat_tensors[n]._y = torch.cat(
              (points2d_as_flat_tensors[n]._y, y.flatten())
          )
      points2d_as_flat_tensors[n]._camera_ids.append(camera_id)
  
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 10 for calling the RaySampler obj's underlying member method code with example usage: obj._add_points2d_as_flat_tensors_to_num_ray_dict(n, x, y, camera_id, points2d_as_flat_tensors) without return types