from what I see in the code…the “print(’[Epoch:{}], loss = {}, time = {}’.format(epoch+1, loss, t1-t0))”   …is outside the loop of train_loader so even though the batch size is 1 you are printing it only after the epoch is finish …may be because of this you are seeing that it is loading all the data as the printing is done after the epoch.