Sequence-Aware Recommender Systems

https://d2l.ai/chapter_recommender-systems/seqrec.html

Hi, there is one thing in the defintion of SeqDataset that does not seem right to me.

During the execution of this statement,

self.test_seq[uid][:] = i_seq[-L:]

If a user has interacted with less than L items, then the length of i_seq would be smaller than L, according to the method _win. This would lead to an error.
The problem does not come up in the sample, because every user has interacted with more than L items.
However, if we make a slight change to the code, then

I am not sure how to fix this, since it is related to the input of the model. One way might be dropping that user sample altogther, but that does not seem to be consistent with the logic calculating the size of the samples.