The number seems to be formatted a bit wrong, but I understand that the input features to the linear layer are defined as seq_len * batch_size * lstm_output_size?
You shouldn’t use the batch size as the number of input features, as this will limit your use case to only this particular size, and assumes that the samples in the batch are somehow related to each other.
Instead, permute the LSTM output so that the batch size is at dim0 and reset the in_features to e.g. seq_len * lstm_output_size.
This will allow you to use arbitrary batch sizes.
Alternatively, you could also use batch_first=True when you are creating an instance of LSTM, which will accept and return the batch size in dim0.