code: def encode(self,
                 data: mx.sym.Symbol,
                 data_length: Optional[mx.sym.Symbol],
                 seq_len: int) -> Tuple[mx.sym.Symbol, mx.sym.Symbol, int]:
          
  
          # (1, source_seq_len)
          positions = mx.sym.expand_dims(data=mx.sym.arange(start=0, stop=seq_len, step=1), axis=0)
  
          # (1, source_seq_len, num_embed)
          pos_embedding = mx.sym.Embedding(data=positions,
                                           input_dim=self.max_seq_len,
                                           weight=self.embed_weight,
                                           output_dim=self.num_embed,
                                           name=self.prefix + "pos_embed")
          return mx.sym.broadcast_add(data, pos_embedding, name="%s_add" % self.prefix), data_length, seq_len
docs: :param data: (batch_size, source_seq_len, num_embed)
          :param data_length: (batch_size,)
          :param seq_len: sequence length.
          :return: (batch_size, source_seq_len, num_embed)