tf.data.experimental.get_next_as_optional

View source on GitHub

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

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

Args
iterator A tf.compat.v1.data.Iterator object.
Returns
An Optional object representing the next value from the iterator (if it has one) or no value.

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/data/experimental/get_next_as_optional