tensorflow dataset cache cross validation
Answering my own question, to do this, I can create a pipeline for each file, cache each pipeline on disk, put them into deque, then use tf.data.experimental.sample_from_datasets.
I have a very expensive data pipeline. I want to use tf.data.Dataset.cache to cache the first epoch dataset to disk. Then speed up the process. The reason I'm doing this instead of saving the dataset into tfrecords is
1) I change many parameters doing the processing every time, it is more convenient for me to cache it on the fly
2) I'm doing cross-validation so I don't know which files to process
I have a naive solution - to create a pipeline for each fold of the training files, but that takes a lot of space to cache (I'm doing 10 fold) that's equivalent of 1TB in total. 
Is there any other way to do this more efficiently both in space and in time?