class_docstr: Renders a novel synthesis view of a trained NeRF model for given camera.
docstr: Constructor method.
  
  Args:
      nerf_model: NeRF model.
      image_size: image size.
      device: device to run the model on.
      dtype: dtype to run the model on.
docstr_tok: ["Constructor","method",".","Args",":","nerf_model",":","NeRF","model",".","image_size",":","image","size",".","device",":","device","to","run","the","model","on",".","dtype",":","dtype","to","run","the","model","on","."]
code: def __init__(
      self,
      nerf_model: NerfModel,
      image_size: tuple[int, int],
      device: torch.device | None,
      dtype: torch.dtype | None,
  ) -> None:
      """Constructor method.
  
      Args:
          nerf_model: NeRF model.
          image_size: image size.
          device: device to run the model on.
          dtype: dtype to run the model on.
      """
      self._nerf_model = nerf_model
      self._image_size = image_size
      self._device = device
      self._dtype = dtype
  
      self._pixels_grid, self._ones = self._create_pixels_grid()
  
imports: from __future__ import annotations
  import torch
  from torch import nn
  from torch.nn import functional
  from kornia.core import Module, Tensor
  from kornia.geometry.camera import PinholeCamera
  from kornia.geometry.ray import Ray
  from kornia.nerf.positional_encoder import PositionalEncoder
  from kornia.nerf.samplers import sample_lengths, sample_ray_points
  from kornia.nerf.volume_renderer import IrregularRenderer, RegularRenderer
  from kornia.utils._compat import torch_inference_mode
  from kornia.utils.grid import create_meshgrid
label_desc: Use image node_id 1 to create a new NerfModelRenderer object  with example: obj = NerfModelRenderer(nerf_model, image_size, device, dtype)