class_docstr: Positional encoding module.
  
  :param int n_units: embedding dim
  :param float dropout: dropout rate
  :param int length: maximum input length
docstr: Initialize Positional Encoding.
docstr_tok: ["Initialize","Positional","Encoding","."]
code: def __init__(self, n_units, dropout=0.1, length=5000):
      """Initialize Positional Encoding."""
      # Implementation described in the paper
      super(PositionalEncoding, self).__init__()
      self.dropout = dropout
      posi_block = np.arange(0, length, dtype=np.float32)[:, None]
      unit_block = np.exp(
          np.arange(0, n_units, 2, dtype=np.float32)
          * -(np.log(10000.0) / n_units)
      )
      self.pe = np.zeros((length, n_units), dtype=np.float32)
      self.pe[:, ::2] = np.sin(posi_block * unit_block)
      self.pe[:, 1::2] = np.cos(posi_block * unit_block)
      self.scale = np.sqrt(n_units)
  
imports: import chainer
  import chainer.functions
  import numpy
label_desc: Use image node_id 1 to create a new PositionalEncoding object from inherited base classes: chainer with example: obj = PositionalEncoding(n_units, dropout, length)