The document is quite clear…
version: torch1.0.1
In:
print(torch.utils.data.Dataset.doc)
Out:
An abstract class representing a Dataset.

All other datasets should subclass it. All subclasses should override
``__len__``, that provides the size of the dataset, and ``__getitem__``,
supporting integer indexing in range from 0 to len(self) exclusive.

One can also use predefined subclasses of torch.utils.data.Dataset, e.g. tensorDataset, IterableDataset, all available after 1.0.1