code: def encode_positions(self,
                           positions: mx.sym.Symbol,
                           data: mx.sym.Symbol) -> mx.sym.Symbol:
          
  
          # (batch_size, 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)
docs: :param positions: (batch_size,)
          :param data: (batch_size, num_embed)
          :return: (batch_size, num_embed)