class_docstr: Local Implicit Grid layer.
    
docstr: Initialization function.
  
  Args:
    size: list or tuple of ints, grid dimension in each dimension.
    in_features: int, number of input channels.
    out_features: int, number of output channels.
    x_location_max: float, relative coordinate range for one voxel.
    num_filters: int, number of filters for refiner.
    net_type: str, one of occnet/deepsdf.
    method: str, one of linear/nn.
    interp: bool, interp final results across neighbors (only in linear mode).
    min_grid_value: tuple, lower bound of query points.
    max_grid_value: tuple, upper bound of query points.
    name: str, name of the layer.
code: def __init__(
      self,
      size=(32, 32, 32),
      in_features=16,
      out_features=1,
      x_location_max=1,
      num_filters=128,
      net_type="imnet",
      method="linear",
      interp=True,
      min_grid_value=(0, 0, 0),
      max_grid_value=(1, 1, 1),
      name="lvoxgrid",
  ):
      """Initialization function.
  
      Args:
        size: list or tuple of ints, grid dimension in each dimension.
        in_features: int, number of input channels.
        out_features: int, number of output channels.
        x_location_max: float, relative coordinate range for one voxel.
        num_filters: int, number of filters for refiner.
        net_type: str, one of occnet/deepsdf.
        method: str, one of linear/nn.
        interp: bool, interp final results across neighbors (only in linear mode).
        min_grid_value: tuple, lower bound of query points.
        max_grid_value: tuple, upper bound of query points.
        name: str, name of the layer.
      """
      super(LocalImplicitGrid, self).__init__(name=name)
      # Print warning if x_location_max and method do not match
      if not (
          (x_location_max == 1 and method == "linear")
          or (x_location_max == 2 and method == "nn")
      ):
          raise ValueError(
              "Bad combination of x_location_max and method."
          )
      self.cin = in_features
      self.cout = out_features
      self.dim = len(size)
      self.x_location_max = x_location_max
      self.interp = interp
      self.min_grid_value = min_grid_value
      self.max_grid_value = max_grid_value
      self.num_filters = num_filters
      if self.dim not in [2, 3]:
          raise ValueError(
              "`size` must be tuple or list of len 2 or 3."
          )
      if net_type == "imnet":
          self.net = implicit_nets.ImNet(
              in_features=in_features, num_filters=num_filters
          )
      elif net_type == "deepsdf":
          self.net = implicit_nets.DeepSDF(
              in_features=in_features, num_filters=num_filters
          )
      else:
          raise NotImplementedError
      if method not in ["linear", "nn"]:
          raise ValueError("`method` must be `linear` or `nn`.")
      self.method = method
      self.size_tensor = tf.constant(size)
      self.size = size
      if size[0] == size[1] == size[2] == 1:
          self.cubesize = None
      else:
          self.cubesize = tf.constant(
              [1 / (r - 1) for r in size], dtype=tf.float32
          )
  
file_path: graphics/tensorflow_graphics/projects/local_implicit_grid/core/local_implicit_grid_layer.py
imports: import tensorflow.compat.v1
  from tensorflow_graphics.projects.local_implicit_grid.core import implicit_nets
  from tensorflow_graphics.projects.local_implicit_grid.core import regular_grid_interpolation
label_desc: Use image node_id 1 to create a new LocalImplicitGrid object from inherited base classes: layers with example: obj = LocalImplicitGrid(size, in_features, out_features, x_location_max, num_filters, net_type, method, interp, min_grid_value, max_grid_value, name)