class_docstr: Shape and appearance conditioned network for radiance fields.
class_docstr_tok: ["Shape","and","appearance","conditioned","network","for","radiance","fields","."]
docstr: Renders the network output into rgb and density values.
  
  Args:
    rgb_density: A tensor of shape `[B*R*S, 4]` where B is the batch size,
    R is the number of rays, S is the number of samples per ray.
    ray_points: A tensor of shape `[B, R, S, 3]`.
  
  Returns:
    A tensor of shape `[B, R, 3]` and a tensor of shape `[B, R, C]`.
docstr_tok: ["Renders","the","network","output","into","rgb","and","density","values",".","Args",":","rgb_density",":","A","tensor","of","shape","`","[","B","*","R","*","S",",","4","]","`","where","B","is","the","batch","size",",","R","is","the","number","of","rays",",","S","is","the","number","of","samples","per","ray",".","ray_points",":","A","tensor","of","shape","`","[","B",",","R",",","S",",","3","]","`",".","Returns",":","A","tensor","of","shape","`","[","B",",","R",",","3","]","`","and","a","tensor","of","shape","`","[","B",",","R",",","C","]","`","."]
code: def render_network_output(self, rgb_density, ray_points):
      """Renders the network output into rgb and density values.
  
      Args:
        rgb_density: A tensor of shape `[B*R*S, 4]` where B is the batch size,
        R is the number of rays, S is the number of samples per ray.
        ray_points: A tensor of shape `[B, R, S, 3]`.
  
      Returns:
        A tensor of shape `[B, R, 3]` and a tensor of shape `[B, R, C]`.
  
      """
      target_shape = tf.concat(
          [tf.shape(ray_points)[:-1], [4]], axis=-1
      )
      rgb_density = tf.reshape(rgb_density, target_shape)
      rgb, density = tf.split(rgb_density, [3, 1], axis=-1)
      rgb = tf.sigmoid(rgb)
      density = tf.nn.relu(density)
      rgb_density = tf.concat([rgb, density], axis=-1)
      dists = utils.get_distances_between_points(ray_points)
      rgb_render, a_render, weights = ray_radiance.compute_radiance(
          rgb_density, dists
      )
      if self.white_background:
          rgb_render = rgb_render + 1 - a_render
      return rgb_render, weights
  
imports: from absl import logging
  import numpy
  import tensorflow
  import tensorflow_graphics.geometry.representation.ray
  import tensorflow_graphics.math.feature_representation
  import tensorflow_graphics.projects.radiance_fields.nerf.layers
  import tensorflow_graphics.projects.radiance_fields.sharf.voxel_functions
  import tensorflow_graphics.projects.radiance_fields.utils
  import tensorflow_graphics.rendering.volumetric.ray_radiance
label_desc: Use image node_id 9 for calling the AppearanceNetwork obj's underlying member method code with example usage: obj.render_network_output(rgb_density, ray_points) and returns: rgb_render,  weights