The comment says that the sequences are truncated and padded at the end. However, the following code calls keras.utils.data_utils.pad_sequences (which we can see using the help() function). This function will by default truncate and pad in the beginning. When we look at the documentation for tf.keras.preprocessing.sequence, it says that this API is deprecated. I don't know that function should be used in the end, but the description and the code do not match. Maybe
https://github.com/csc-training/intro-to-dl/blob/4e99811d1fc7c3e22f4413938fcc9f949c1601dc/day1/04-tf2-imdb-rnn.ipynb#L78
The comment says that the sequences are truncated and padded at the end. However, the following code calls
keras.utils.data_utils.pad_sequences
(which we can see using thehelp()
function). This function will by default truncate and pad in the beginning. When we look at the documentation for tf.keras.preprocessing.sequence, it says that this API is deprecated. I don't know that function should be used in the end, but the description and the code do not match. Maybeshould be added or the description changed.