Multiple options:

custom module:

class TakeFirst(nn.Module):
  def forward(self, x):
    return x[0]



Activate nn.Sequential(..., LSTM) first, then feed the first result into a second nn.Sequential.


As @tom said, don’t use nn.Sequential altogether. Spell out the steps in a custom module.


The reason that this is not a bug is because ``nn.Squential` is just supposed to put the output as the next’s input. Automatically taking the first is something that it never promised to do.
nn.Sequential is just a convenient wrapper class. If it doesn’t work the best for you, just use other more suitable approaches.