class_docstr: Implicit function as used in http://github.com/lioryariv/idr.
  
  Members:
      d_in: dimension of the input point.
      n_harmonic_functions_xyz: If -1, do not embed the point.
          If >=0, use a harmonic embedding with this number of
          harmonic functions. (The harmonic embedding includes the input
          itself, so a value of 0 means the point is used but without
          any harmonic functions.)
      d_out and feature_vector_size: Sum of these is the output
          dimension. This implicit function thus returns a concatenation
          of `d_out` signed distance function values and `feature_vector_size`
          features (such as colors). When used in `GenericModel`,
          `feature_vector_size` corresponds is automatically set to
          `render_features_dimensions`.
      dims: list of hidden layer sizes.
      geometric_init: whether to use custom weight initialization
          in linear layers. If False, pytorch default (uniform sampling)
          is used.
      bias: if geometric_init=True, initial value for bias subtracted
          in the last layer.
      skip_in: List of indices of layers that receive as input the initial
          value concatenated with the output of the previous layers.
      weight_norm: whether to apply weight normalization to each layer.
      pooled_feature_dim: If view pooling is in use (provided as
          fun_viewpool to forward()) this must be its number of features.
          Otherwise this must be set to 0. (If used from GenericModel,
          this config value will be overridden automatically.)
      encoding_dim: If global coding is in use (provided as global_code
          to forward()) this must be its number of featuress.
          Otherwise this must be set to 0. (If used from GenericModel,
          this config value will be overridden automatically.)
code: def forward(
      self,
      *,
      ray_bundle: Optional[ImplicitronRayBundle] = None,
      rays_points_world: Optional[torch.Tensor] = None,
      fun_viewpool=None,
      global_code=None,
      **kwargs,
  ):
      # this field only uses point locations
      # rays_points_world.shape = [minibatch x ... x pts_per_ray x 3]
      rays_points_world = get_rays_points_world(
          ray_bundle, rays_points_world
      )
  
      if rays_points_world.numel() == 0 or (
          self.embed_fn is None
          and fun_viewpool is None
          and global_code is None
      ):
          return torch.tensor(
              [],
              device=rays_points_world.device,
              dtype=rays_points_world.dtype,
          ).view(0, self.out_dim)
  
      embeddings = []
      if self.embed_fn is not None:
          embeddings.append(self.embed_fn(rays_points_world))
  
      if fun_viewpool is not None:
          assert rays_points_world.ndim == 2
          pooled_feature = fun_viewpool(rays_points_world[None])
          # TODO: pooled features are 4D!
          embeddings.append(pooled_feature)
  
      if global_code is not None:
          assert (
              global_code.shape[0] == 1
          )  # TODO: generalize to batches!
          # This will require changing raytracer code
          # embedding = embedding[None].expand(global_code.shape[0], *embedding.shape)
          embeddings.append(
              global_code[0, None, :].expand(
                  rays_points_world.shape[0], -1
              )
          )
  
      embedding = torch.cat(embeddings, dim=-1)
      x = embedding
      for layer_idx in range(self.num_layers - 1):
          if layer_idx in self.skip_in:
              x = torch.cat([x, embedding], dim=-1) / 2**0.5
  
          x = self.linear_layers[layer_idx](x)
  
          if layer_idx < self.num_layers - 2:
              x = self.softplus(x)
  
      return x
  
file_path: pytorch3d/pytorch3d/implicitron/models/implicit_function/idr_feature_field.py
imports: import math
  from typing import Optional, Tuple
  import torch
  from pytorch3d.implicitron.models.renderer.base import ImplicitronRayBundle
  from pytorch3d.implicitron.tools.config import registry
  from pytorch3d.renderer.implicit import HarmonicEmbedding
  from torch import nn
  from .base import ImplicitFunctionBase
  from .utils import get_rays_points_world
label_desc: Use image node_id 2 for calling the IdrFeatureField obj's underlying member method code with example usage: obj.forward() and returns: x, torch