@chris, Thanks for the information. If I use
out = lstm_out.contiguous().view(batch_size, -1)

out will be tensor of dim (batch_size, seq_le * hidden_dim). suppose I concatenate this with output of nn.Linear(10,20) and I want to pass the concatenated out through other nn.Linear(a,b).
How can I dynamically initialize dimension ‘a’  as it also depends on seq_length indirectly.(Actually a will be (seq_len * hidden_dim) + 20). But how can i pass this during initialization.