Hello, friends of the Forum.
In the PyTorch chatbot tutorial, the pad_packed_sequence is used after the variable_length sequence is processed by the pack_padded_sequence. Finally, the maskLoss function is defined.
But I saw in other books:
After the pack_padded_sequence processing on the variable-length sequence, there is no pad_packed_sequence, and then the loss is calculated directly using the official API-CrossEntropyLoss.