class_docstr: A base class for Neural Radiance Fields (NeRF) models.
  
  Args:
      num_input_dims (int): Number of input dimensions.
      bound (torch.Tensor): The bounding box tensor.
      density_activation (DensityActivationEnum): Activation function for density.
      blob_radius (float): Radius for the blob.
      blob_density (float): Density for the blob.
      normal_type (Optional[NormalTypeEnum]): Method to compute normals.
class_docstr_tok: ["A","base","class","for","Neural","Radiance","Fields","(","NeRF",")","models",".","Args",":","num_input_dims","(","int",")",":","Number","of","input","dimensions",".","bound","(","torch.Tensor",")",":","The","bounding","box","tensor",".","density_activation","(","DensityActivationEnum",")",":","Activation","function","for","density",".","blob_radius","(","float",")",":","Radius","for","the","blob",".","blob_density","(","float",")",":","Density","for","the","blob",".","normal_type","(","Optional","[","NormalTypeEnum","]",")",":","Method","to","compute","normals","."]
docstr: Compute the features based on the input positions and their encoding.
  
  Args:
      positions (torch.Tensor): Input positions tensor with shape [B*N, D].
      positions_encoding (Optional[torch.Tensor]): Optional encoded positions.
          Will be computed from `positions` if not provided.
  
  Returns:
      torch.Tensor: Features tensor with shape [B*N, num_features_dims].
docstr_tok: ["Compute","the","features","based","on","the","input","positions","and","their","encoding",".","Args",":","positions","(","torch.Tensor",")",":","Input","positions","tensor","with","shape","[","B","*","N",",","D","]",".","positions_encoding","(","Optional","[","torch.Tensor","]",")",":","Optional","encoded","positions",".","Will","be","computed","from","`","positions","`","if","not","provided",".","Returns",":","torch.Tensor",":","Features","tensor","with","shape","[","B","*","N",",","num_features_dims","]","."]
code: def forward_features(
      self,
      positions: torch.Tensor,
      positions_encoding: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      """
      Compute the features based on the input positions and their encoding.
  
      Args:
          positions (torch.Tensor): Input positions tensor with shape [B*N, D].
          positions_encoding (Optional[torch.Tensor]): Optional encoded positions.
              Will be computed from `positions` if not provided.
  
      Returns:
          torch.Tensor: Features tensor with shape [B*N, num_features_dims].
      """
  
      # Handle empty positions
      if positions.shape[0] == 0:
          features = torch.zeros(
              0, self.num_features_dims, device=positions.device
          )
          return features
  
      # Compute encoded positions if not provided
      if positions_encoding is None:
          positions_encoding = self.encode(positions)
  
      # Compute features using the neural network
      features = self.features_net(positions_encoding)
  
      # Apply the sigmoid activation function to the features
      features = torch.sigmoid(features)
  
      return features
  
imports: from enum import Enum
  from typing import Optional, Tuple
  import mcubes
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import trimesh
  from nemo.collections.multimodal.modules.nerf.utils.activation import trunc_exp
label_desc: Use image node_id 8 for calling the NeRFBase obj's underlying member method code with example usage: obj.forward_features(positions, positions_encoding) and returns: features, features