Based on the error message I guess the output of self.rnn might be too large for the following linear layer.
Unfortunately, the shapes are undefined in your code so that I cannot debug it.
Could you check the shape of hiddens and make sure it matches the expected shape of self.decoder_linear?