pchandrasekaran:

It works, but I have no idea why this specific “reshape”.


The RNN Module  returns 2 output tensors, the outputs after each iteration and the last hidden state. We only use first, which is of shape [Batch, Seq, Hidden] with batch_first=True and num_directions=1. bibekx most likely only wants the output of the last iteration, so we slice it with [:, -1, :]. Best use of this slicing would be in the forward call in classification_RNN, right before we feed it into the linear layer.