lstm_out contains the last hidden states (last w.r.t to the number of layers) of all time steps. So
out = lstm_out.contiguous().view(-1,self.hidden_dim) 

will have a shape of (batch_size*seq_len, hidden_dim). Depending what you want, you can change it to
out = lstm_out.contiguous().view(batch_size, -1)

resulting in a shape of (batch_size, seq_len*hidden_dim). Again, this would mean you would consider all time steps for further processing. If you want only the last hidden state (last w.r.t. to number of layers AND time steps), you could do:
out = lstm_out[ : , -1, : ]  

which will give you a shape of (batch_size, hidden_dim)