Thank you @ptrblck, This is what I was looking for .
Suppose after feeding the data input to the CNN model, it outputs variable length like the example below.
CNN Shape==========> torch.Size([2, 128, 5, 28])
CNN Shape==========> torch.Size([2, 128, 9, 28])

Now When I am feeding this to the LSTM after performing the below mentioned operations
x = x.view(x.size(0), -1, x.size(3)) # [batch_size, features=channels*height, seq_len=width]
x = x.permute(2, 0, 1) # [seq_len, batch_size, features]

It is giving the error
input.size(-1) must be equal to input_size.
How the variable length from the CNNs is handled before feeding it the LSTM
Sure I will be careful in future.
Actually your explanations are very clear and to the point and I really enjoy those.