docstr: This function takes `features` predicted by `self.mlp_xyz`
  and converts them to `raw_densities` with `self.density_layer`.
  `raw_densities` are later re-weighted using the depth step sizes
  and mapped to [0-1] range with 1 - inverse exponential of `raw_densities`.
docstr_tok: ["This","function","takes","`","features","`","predicted","by","`","self.mlp_xyz","`","and","converts","them","to","`","raw_densities","`","with","`","self.density_layer","`",".","`","raw_densities","`","are","later","re-weighted","using","the","depth","step","sizes","and","mapped","to","[","0-1","]","range","with","1","-","inverse","exponential","of","`","raw_densities","`","."]
code: def _get_densities(
      self,
      features: torch.Tensor,
      depth_values: torch.Tensor,
      density_noise_std: float,
  ) -> torch.Tensor:
      """
      This function takes `features` predicted by `self.mlp_xyz`
      and converts them to `raw_densities` with `self.density_layer`.
      `raw_densities` are later re-weighted using the depth step sizes
      and mapped to [0-1] range with 1 - inverse exponential of `raw_densities`.
      """
      raw_densities = self.density_layer(features)
      deltas = torch.cat(
          (
              depth_values[..., 1:] - depth_values[..., :-1],
              1e10 * torch.ones_like(depth_values[..., :1]),
          ),
          dim=-1,
      )[..., None]
      if density_noise_std > 0.0:
          raw_densities = (
              raw_densities
              + torch.randn_like(raw_densities) * density_noise_std
          )
      densities = 1 - (-deltas * torch.relu(raw_densities)).exp()
      return densities
  
file_path: pytorch3d/projects/nerf/nerf/implicit_function.py
imports: from typing import Tuple
  import torch
  from pytorch3d.common.linear_with_repeat import LinearWithRepeat
  from pytorch3d.renderer import HarmonicEmbedding, ray_bundle_to_ray_points, RayBundle
label_desc: Use image node_id 2 for calling the NeuralRadianceField obj's underlying member method code with example usage: obj._get_densities(features, depth_values, density_noise_std) and returns: densities