In PyTorch LSTM model, you need not/can’t specify sequence length. Here sequence length of the model depends on the input data. As in your code you have specified ‘batch_first=True’, the data dimension should be (batch size, seq length, input feature dimension ). In your case the data given to LSTM model should have a shape of (200,4,16839)  .