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].
  
  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
class_docstr_tok: ["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","]",".","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"]
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)`.
docstr_tok: ["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: torch.Tensor) -> torch.Tensor:
      """
      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
      for li, layer in enumerate(self.mlp):
          if li in self._input_skips:
              y = torch.cat((y, z), dim=-1)
          y = layer(y)
      return y
  
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 MLPWithInputSkips obj's underlying member method code with example usage: obj.forward(x, z) and returns: y