def _create_pixels_grid(self) -> tuple[Tensor, Tensor]:
        """Create the pixels grid to unproject to plane z=1.

        Args:
            image_size: image size: tuple[int, int]

        Returns:
            - Pixels grid: Tensor (1, H, W, 2)
            - Ones: Tensor (H*W, 1)

        """
        height, width = self._image_size
        pixels_grid: Tensor = create_meshgrid(
            height, width, normalized_coordinates=False, device=self._device, dtype=self._dtype
        )  # 1xHxWx2
        pixels_grid = pixels_grid.reshape(-1, 2)  # (H*W)x2

        ones = torch.ones(pixels_grid.shape[0], 1, device=pixels_grid.device, dtype=pixels_grid.dtype)  # (H*W)x1

        return pixels_grid, ones
Create the pixels grid to unproject to plane z=1.

        Args:
            image_size: image size: tuple[int, int]

        Returns:
            - Pixels grid: Tensor (1, H, W, 2)
            - Ones: Tensor (H*W, 1)

        
kornia/nerf/nerf_model.py