To be honest, I didn’t really check your code…to tight on time :). However, I have some (I hope) working implementations 7 of autoencoders that might be worth to have a look.
I noticed an ample use if reshape() in your code, which might be perfectly correct. But it can be a cause of issues; see this post. Lastly, if your encoder and decoder are “symmetric” – that is, the same number of hidden dimensions and layers – you can directly copy the last hidden state, and there should be no need for repeat() and such things.