tf.data.experimental.get_next_as_optional

Returns an Optional that contains the next value from the iterator.

Compat aliases for migration

See Migration guide for more details.

tf.compat.v1.data.experimental.get_next_as_optional

If iterator has reached the end of the sequence, the returned Optional will have no value.

iterator An iterator for an instance of tf.data.Dataset.

An Optional object representing the next value from the iterator (if it has one) or no value.