docstr_tok: []
code: def __init__(
      self,
      depth=8,
      width=256,
      input_ch=3,
      input_ch_views=3,
      output_ch=4,
      skips=[4],
      use_viewdirs=False,
      scale=1.0,
      scale_type="no",
  ):
      """ """
      super(NeRF, self).__init__()
      self.depth = depth
      self.width = width
      self.input_ch = input_ch
      self.input_ch_views = input_ch_views
      self.skips = skips
      self.use_viewdirs = use_viewdirs
      self.scale = scale
      self.scale_type = scale_type
  
      self.pts_linears = nn.ModuleList(
          [nn.Linear(input_ch, width)]
          + [
              nn.Linear(width, width)
              if i not in self.skips
              else nn.Linear(width + input_ch, width)
              for i in range(depth - 1)
          ]
      )
  
      if use_viewdirs:
          self.views_linears = nn.ModuleList(
              [nn.Linear(input_ch_views + width, width // 2)]
          )
          self.feature_linear = nn.Linear(width, width)
          self.alpha_linear = nn.Linear(width, 1)
          self.rgb_linear = nn.Linear(width // 2, 3)
      else:
          self.output_linear = nn.Linear(width, output_ch)
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  import numpy
label_desc: Use image node_id 1 to create a new NeRF object from inherited base classes: nn with example: obj = NeRF(depth, width, input_ch, input_ch_views, output_ch, skips, use_viewdirs, scale, scale_type)