Sorry for chiming in without providing an answer.
I’m also trying to get a hang on autoencoder, be it based on CNNs or RNNs. I was just wondering, why do need to expand() for an RNN autoencoder. Assuming that you use the same parameters for the encoder and decoder, the hidden state of the encoder can be directly used for the decoder. Sure, you can first push it through a bottleneck to reduce the dimension but I cannot see the need for expand(). The shape of the hidden state is (num_layers*num_directions, batch_size, embed_dim). Why is there a need for a <max_length>.
In my current RNN-based autoencoder I don’t have the need for that. But it’s not unlikely that I’m doing it wrong :).