class_docstr: Relative positional encodings.
class_docstr_tok: ["Relative","positional","encodings","."]
code: def __init__(self, hparams=None):
      ModuleBase.__init__(self, hparams)
      self.sinusoid_embed = PositionalEmbedding(self._hparams.dim)
  
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 1 to create a new RelativePositionalEncoding object from inherited base classes: ModuleBase with example: obj = RelativePositionalEncoding(hparams)