class_docstr: Implements the multi-layer perceptron architecture of the Neural Radiance Field.
  
  As such, `MLPWithInputSkips` is a multi layer perceptron consisting
  of a sequence of linear layers with ReLU activations.
  
  Additionally, for a set of predefined layers `input_skips`, the forward pass
  appends a skip tensor `z` to the output of the preceding layer.
  
  Note that this follows the architecture described in the Supplementary
  Material (Fig. 7) of [1], for which keep the defaults for:
      - `last_layer_bias_init` to None
      - `last_activation` to "relu"
      - `use_xavier_init` to `true`
  
  If you want to use this as a part of the color prediction in TensoRF model set:
      - `last_layer_bias_init` to 0
      - `last_activation` to "sigmoid"
      - `use_xavier_init` to `False`
  
  References:
      [1] Ben Mildenhall and Pratul P. Srinivasan and Matthew Tancik
          and Jonathan T. Barron and Ravi Ramamoorthi and Ren Ng:
          NeRF: Representing Scenes as Neural Radiance Fields for View
          Synthesis, ECCV2020
  
  Members:
      n_layers: The number of linear layers of the MLP.
      input_dim: The number of channels of the input tensor.
      output_dim: The number of channels of the output.
      skip_dim: The number of channels of the tensor `z` appended when
          evaluating the skip layers.
      hidden_dim: The number of hidden units of the MLP.
      input_skips: The list of layer indices at which we append the skip
          tensor `z`.
      last_layer_bias_init: If set then all the biases in the last layer
          are initialized to that value.
      last_activation: Which activation to use in the last layer. Options are:
          "relu", "softplus", "sigmoid" and "identity". Default is "relu".
      use_xavier_init: If True uses xavier init for all linear layer weights.
          Otherwise the default PyTorch initialization is used. Default True.
docstr: Args:
      x: The input tensor of shape `(..., input_dim)`.
      z: The input skip tensor of shape `(..., skip_dim)` which is appended
          to layers whose indices are specified by `input_skips`.
  Returns:
      y: The output tensor of shape `(..., output_dim)`.
code: def forward(self, x: torch.Tensor, z: Optional[torch.Tensor] = None):
      """
      Args:
          x: The input tensor of shape `(..., input_dim)`.
          z: The input skip tensor of shape `(..., skip_dim)` which is appended
              to layers whose indices are specified by `input_skips`.
      Returns:
          y: The output tensor of shape `(..., output_dim)`.
      """
      y = x
      if z is None:
          # if the skip tensor is None, we use `x` instead.
          z = x
      skipi = 0
      for li, layer in enumerate(self.mlp):
          if li in self._input_skips:
              if self._skip_affine_trans:
                  y = self._apply_affine_layer(
                      self.skip_affines[skipi], y, z
                  )
              else:
                  y = torch.cat((y, z), dim=-1)
              skipi += 1
          y = layer(y)
      return y
  
imports: import logging
  from dataclasses import field
  from enum import Enum
  from typing import Dict, Optional, Tuple
  import torch
  from omegaconf import DictConfig
  from pytorch3d.implicitron.tools.config import Configurable, registry, ReplaceableBase, run_auto_creation
label_desc: Use image node_id 4 for calling the MLPWithInputSkips obj's underlying member method code with example usage: obj.forward(x, z) and returns: y