Solved by albanD in post #2 
              
              
                The self.decoder here is just the linear layer to goes from the hidden units to the output size. 
And to decode all the outputs for each time step and each element in that batch, it reshape the output tensor that was (where x is the separator for different dimensions) batch x nb_steps x hidden_size …