The CIFAR10 dataset doesn’t download all images separately, but the binary data as seen here 6, so you won’t be able to return paths to each image.
However, in other datasets, which lazily load each image file, you can just return the path with the data and target tensors.