code: def positional_encoding(
      features: TensorLike,
      num_frequencies: int,
      name: str = "positional_encoding",
  ) -> TensorLike:
      """Positional enconding of a tensor as described in the NeRF paper (https://arxiv.org/abs/2003.08934).
  
      Args:
        features: A tensor of shape `[A1, ..., An, M]` where M is the dimension
           of the features.
        num_frequencies: Number N of frequencies for the positional encoding.
        name: A name for this op that defaults to "positional_encoding".
  
      Returns:
        A tensor of shape `[A1, ..., An, 2*N*M + M]`.
      """
      with tf.name_scope(name):
          features = tf.convert_to_tensor(value=features)
  
          output = [features]
          for i in range(num_frequencies):
              for fn in [tf.sin, tf.cos]:
                  output.append(fn(2.0**i * features))
          return tf.concat(output, -1)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from six.moves import range
  import tensorflow
  from tensorflow_graphics.util import export_api
  from tensorflow_graphics.util.type_alias import TensorLike
label_desc: Use image node_id 1 for calling a global function with example usage: positional_encoding(features, num_frequencies, name) and returns: tf