I guess Keras’ LSTM layer might return the last temporal step by default, so you could index the output from the PyTorch LSTM layer via output[:, -1] assuming that your current batch size is 64 and you’ve used batch_first=True.