Hi,
Have a look here to see how a generic Dataset can be implemented:

  
      github.com
  
  
    pytorch/vision/blob/master/torchvision/datasets/cifar.py 181
from __future__ import print_function
from PIL import Image
import os
import os.path
import errno
import numpy as np
import sys
if sys.version_info[0] == 2:
    import cPickle as pickle
else:
    import pickle

import torch.utils.data as data
from .utils import download_url, check_integrity


class CIFAR10(data.Dataset):
    """`CIFAR10 <https://www.cs.toronto.edu/~kriz/cifar.html>`_ Dataset.

    Args:


  This file has been truncated. show original

  
  
    
    
  
  


In particular, the __getitiem__ method, which returns a tuple comprising (data, label)
The generic loop is something like:
for (data, labels) in dataloader:
    # train / eval code

You’re free to ignore the label here and you can train an autoencoder on cifar10, for example, pretty much out of the box.