class_docstr: Sinosoidal Positional Embedding.
      
class_docstr_tok: ["Sinosoidal","Positional","Embedding","."]
docstr: Compute sinosoidal positional embeddings.
  
  Args:
      pos_seq: A 1D tensor of position sequences
  
  :returns: A 2D tensor of sinosoidal embeddings for the sequence.
docstr_tok: ["Compute","sinosoidal","positional","embeddings",".","Args",":","pos_seq",":","A","1D","tensor","of","position","sequences",":","returns",":","A","2D","tensor","of","sinosoidal","embeddings","for","the","sequence","."]
code: def _build(self, pos_seq):
      r"""Compute sinosoidal positional embeddings.
  
      Args:
          pos_seq: A 1D tensor of position sequences
  
      :returns: A 2D tensor of sinosoidal embeddings for the sequence.
      """
      pos_seq = tf.dtypes.cast(pos_seq, dtype=self.inv_freq.dtype)
      sinusoid_inp = tf.einsum("i,d->id", pos_seq, self.inv_freq)
      pos_emb = tf.concat(
          [tf.sin(sinusoid_inp), tf.cos(sinusoid_inp)], -1
      )
      return pos_emb
  
imports: import tensorflow
  from texar.tf.core import layers
  from texar.tf.module_base import ModuleBase
  from texar.tf.utils.mode import is_train_mode
label_desc: Use image node_id 2 for calling the PositionalEmbedding obj's underlying member method code with example usage: obj._build(pos_seq) and returns: pos_emb