def next(self):
        # print('In Dataset_Iter_Seq_Next')
        if (self.batch_count >= self.num_batches or
           self.sample_count >= self.num_samples):
            raise StopIteration()
        # fixes the problem where (self._num_samples % self._batch_size) != 0
        elif (self.sample_count + self.batch_size) > self.num_samples:
            self.last = slice(self.sample_count, self.num_samples)
            self.sample_count = self.num_samples
            return self.X[self.last, :, :, :]
        else:
            self.last = slice(self.sample_count,
                              self.sample_count + self.batch_size)
            self.sample_count += self.batch_size
            self.batch_count += 1
            return self.X[self.last, :, :, :], self.y[self.last]
dataset/ETHPy150Open ifp-uiuc/anna/anna/datasets/supervised_dataset.py/DatasetIteratorSequential.next/original