class_docstr: Shape and appearance conditioned network for radiance fields.
class_docstr_tok: ["Shape","and","appearance","conditioned","network","for","radiance","fields","."]
docstr: Estimate the positional encoding of the 3D position and direction of the samples along a ray.
  
  Args:
    ray_points: A tensor of shape `[B, R, S, 3]` where B is the batch size, R
      is the number of rays, S is the number of samples per ray.
    ray_dirs: A tensor of shape `[B, R, 3]` where B is the batch size, R
    is the number of rays.
  
  Returns:
    A list containing a tensor of shape `[B, R, S, M]` and a tensor of shape
    `[B, R, S, N]`, where M is the dimensionality of the location positional
    encoding and N is dimensionality of the direction positional encoding.
docstr_tok: ["Estimate","the","positional","encoding","of","the","3D","position","and","direction","of","the","samples","along","a","ray",".","Args",":","ray_points",":","A","tensor","of","shape","`","[","B",",","R",",","S",",","3","]","`","where","B","is","the","batch","size",",","R","is","the","number","of","rays",",","S","is","the","number","of","samples","per","ray",".","ray_dirs",":","A","tensor","of","shape","`","[","B",",","R",",","3","]","`","where","B","is","the","batch","size",",","R","is","the","number","of","rays",".","Returns",":","A","list","containing","a","tensor","of","shape","`","[","B",",","R",",","S",",","M","]","`","and","a","tensor","of","shape","`","[","B",",","R",",","S",",","N","]","`",",","where","M","is","the","dimensionality","of","the","location","positional","encoding","and","N","is","dimensionality","of","the","direction","positional","encoding","."]
code: def prepare_positional_encoding(self, ray_points, ray_dirs):
      """Estimate the positional encoding of the 3D position and direction of the samples along a ray.
  
      Args:
        ray_points: A tensor of shape `[B, R, S, 3]` where B is the batch size, R
          is the number of rays, S is the number of samples per ray.
        ray_dirs: A tensor of shape `[B, R, 3]` where B is the batch size, R
        is the number of rays.
  
      Returns:
        A list containing a tensor of shape `[B, R, S, M]` and a tensor of shape
        `[B, R, S, N]`, where M is the dimensionality of the location positional
        encoding and N is dimensionality of the direction positional encoding.
      """
      n_ray_samples = tf.shape(ray_points)[-2]
      scaled_ray_points = self.scene_scale * (
          ray_points + self.scene_transl
      )
      features_xyz = feature_rep.positional_encoding(
          scaled_ray_points, self.n_freq_posenc_xyz
      )
      ray_dirs = tf.tile(
          tf.expand_dims(ray_dirs, -2), [1, 1, n_ray_samples, 1]
      )
      features_dir = feature_rep.positional_encoding(
          ray_dirs, self.n_freq_posenc_dir
      )
      return features_xyz, features_dir
  
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 8 for calling the AppearanceNetwork obj's underlying member method code with example usage: obj.prepare_positional_encoding(ray_points, ray_dirs) and returns: features_xyz,  features_dir