How dose the PyTorch design the Dataset and Subset for easily using?

Dataset

Subset

  1. Each subset is also a Dataset. So it must inherit the Dataset base class.

  2. They are not ‘actually’ set the data of a Subset to the child collection of the whole Dataset. They use a indices parameter to store the position of the data in the whole Dataset.

  3. __getitem()__