code: def encode(self, inputs, states=None, valid_length=None):
          
          return self.encoder(self.src_embed(inputs), states, valid_length)
docs: Encode the input sequence.
  
          Parameters
          ----------
          inputs : NDArray
          states : list of NDArrays or None, default None
          valid_length : NDArray or None, default None
  
          Returns
          -------
          outputs : list
              Outputs of the encoder.