The problem is:

My 1D-CNN model is supposed to deal with multivariate time-series data with signal length 60.

getitem method in my Dataset class returns data of range [index, index+60]

getitem method returns a data with a shorter signal length than 60 when the index is close to the tail of the data (i.e., index+60 > dataset.length) <-- this is my guess on the cause of the RuntimeError
So this tases RuntimeError that I gave above in the question.

My question is:

Is there any effective or standard way to define a Dataset and DataLoader for 1D-CNN with 2D input data, which may solve the RuntimeError that I’ve got?