def forward(self, origins: Tensor, directions: Tensor) -> Tensor:
        """Forward method.

        Args:
            origins: Ray origins with shape :math:`(B, 3)`.
            directions: Ray directions with shape :math:`(B, 3)`.

        Returns:
            Rendered image pixels :math:`(B, 3)`.

        """
        # Sample xyz for ray parameters
        batch_size = origins.shape[0]
        lengths = sample_lengths(
            batch_size,
            self._num_ray_points,
            device=origins.device,
            dtype=origins.dtype,
            irregular=self._irregular_ray_sampling,
        )  # FIXME: handle the case of hierarchical sampling
        points_3d = sample_ray_points(origins, directions, lengths)

        # Encode positions & directions
        points_3d_encoded = self._pos_encoder(points_3d)
        directions_encoded = self._dir_encoder(F.normalize(directions, dim=-1))

        # Map positional encodings to latent features (MLP with skip connections)
        y = self._mlp(points_3d_encoded)
        y = self._fc1(y)

        # Calculate ray point density values
        densities_ray_points = self._sigma(y)
        densities_ray_points = densities_ray_points + torch.randn_like(densities_ray_points) * 0.1
        densities_ray_points = torch.relu(densities_ray_points)  # FIXME: Revise this

        # Calculate ray point rgb values
        y = torch.cat((y, directions_encoded[..., None, :].expand(-1, self._num_ray_points, -1)), dim=-1)
        y = self._fc2(y)
        rgbs_ray_points = self._rgb(y)

        # Rendering rgbs and densities along rays
        rgbs = self._renderer(rgbs_ray_points, densities_ray_points, points_3d)

        # Return pixel point rendered rgb
        return rgbs
Forward method.

        Args:
            origins: Ray origins with shape :math:`(B, 3)`.
            directions: Ray directions with shape :math:`(B, 3)`.

        Returns:
            Rendered image pixels :math:`(B, 3)`.

        
kornia/nerf/nerf_model.py