Constructs a Dataset iterator.

The method used to construct the iterator is conditioned on whether Graph mode is enabled. dataset_iterator and get_next are useful when we need to construct an iterator and iterate through it inside a tensorflow.function.

dataset a

A if Graph mode is enabled; a if in eager mode.