Thank you very much for your explanation, dear @ptrblck. In order to not collapse the temporal and batch dimension as a result of the view operation, now I don’t apply it. But, still I’m getting the ValueError: Target and input must have the same number of elements. target nelement (64) != input nelement (76800) error.
p.s. Here is the corrected version of the forward function:
def forward(self, text):
    embedded = self.embedding(text)

    lstm_out, hidden = self.lstm(embedded)

    return self.fc(lstm_out)