Solved by ptrblck in post #27 
              
              
                The batch index 19 would get the last part of the dataset wouldn’t it? 
Using 400 samples, a sequence length of 100 and a batch size of 2 seems to work: 
class OUDataset(Dataset):
  def __init__(self, window_size=100):
    self.oudataframe = pd.DataFrame(np.random.randn(400, 2))
    self.window_size…