Thanks Mark. I later revisted that tutorial and found out about that neat method. Solved my purpose.
I think having a separate sampler utility for tf.data pipelines might be better from usability standpoint.