code: def init_state_from_encoder(self, encoder_outputs, encoder_valid_length=None):
          
          mem_value = encoder_outputs
          decoder_states = [mem_value]
          mem_length = mem_value.shape[1]
          if encoder_valid_length is not None:
              dtype = encoder_valid_length.dtype
              ctx = encoder_valid_length.context
              mem_masks = mx.nd.broadcast_lesser(
                  mx.nd.arange(mem_length, ctx=ctx, dtype=dtype).reshape((1, -1)),
                  encoder_valid_length.reshape((-1, 1)))
              decoder_states.append(mem_masks)
          self._encoder_valid_length = encoder_valid_length
          return decoder_states
docs: Initialize the state from the encoder outputs.
  
          Parameters
          ----------
          encoder_outputs : list
          encoder_valid_length : NDArray or None
  
          Returns
          -------
          decoder_states : list
              The decoder states, includes:
  
              - mem_value : NDArray
              - mem_masks : NDArray, optional