Sure this is the easiest way to load your processed dataset in your training script
When you load the dataset, then the full dataset is loaded from your disk. There’s no prefetch function: you can directly access any element at any position in your dataset.
The shuffling is done by shuffling the index of the dataset (i.e. the mapping between what __getitem__ returns and the actual position of the examples on disk). The actual elements on disk are not shuffled. Shuggling the index is done in memory though, and the resulting index is written to disk and loaded from the disk via memory mapping afterwards.