If you use the CIFAR10 dataset from torchvision, the data will be loaded into the memory as you suggested (line of code 9).
I’m not sure, which disc you are using, but have a look at this post 20 for some information on potential bottlenecks.