code: def _encode(self, data: mx.sym.Symbol, data_length: mx.sym.Symbol, seq_len: int) -> mx.sym.Symbol:
          
          # (seq_len, batch_size, num_embed)
          data_reverse = mx.sym.SequenceReverse(data=data, sequence_length=data_length,
                                                use_sequence_length=True)
          # (seq_length, batch, cell_num_hidden)
          hidden_forward, _, _ = self.forward_rnn.encode(data, data_length, seq_len)
          # (seq_length, batch, cell_num_hidden)
          hidden_reverse, _, _ = self.reverse_rnn.encode(data_reverse, data_length, seq_len)
          # (seq_length, batch, cell_num_hidden)
          hidden_reverse = mx.sym.SequenceReverse(data=hidden_reverse, sequence_length=data_length,
                                                  use_sequence_length=True)
          # (seq_length, batch, 2 * cell_num_hidden)
          hidden_concat = mx.sym.concat(hidden_forward, hidden_reverse, dim=2, name="%s_rnn" % self.prefix)
  
          return hidden_concat
docs: Bidirectionally encodes time-major data.