There is a very good SO thread on in-memory dataset created with Tensorflow dataset API. But my case is different that, I have a huge dataset,so have to load from the disk.