Solved by ptrblck in post #2 
              
              
                Based on your description of the use case I would assume your output would have the shape [batch_size, 1] and you are working on a regression task. 
To do so you could pass the output activation from the last time step of the lstm to the linear layer, which should have the expected shape afterwards. …