tf.data.experimental.get_next_as_optional
Stay organized with collections
Save and categorize content based on your preferences.
Returns an Optional
that contains the next value from the iterator.
tf.data.experimental.get_next_as_optional(
iterator
)
If iterator
has reached the end of the sequence, the returned Optional
will have no value.
Returns |
An Optional object representing the next value from the iterator (if it
has one) or no value.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.data.experimental.get_next_as_optional\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/data/experimental/get_next_as_optional) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/ops/iterator_ops.py#L800-L820) |\n\nReturns an `Optional` that contains the next value from the iterator.\n\n#### View aliases\n\n\n**Main aliases**\n\n\\`tf.contrib.data.get_next_as_optional\\`\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.data.experimental.get_next_as_optional`](/api_docs/python/tf/data/experimental/get_next_as_optional), \\`tf.compat.v2.data.experimental.get_next_as_optional\\`\n\n\u003cbr /\u003e\n\n tf.data.experimental.get_next_as_optional(\n iterator\n )\n\nIf `iterator` has reached the end of the sequence, the returned `Optional`\nwill have no value.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|---------------------------------------------------------------------|\n| `iterator` | A [`tf.compat.v1.data.Iterator`](../../../tf/data/Iterator) object. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| An `Optional` object representing the next value from the iterator (if it has one) or no value. ||\n\n\u003cbr /\u003e"]]