tf.data.experimental.get_next_as_optional
Stay organized with collections
Save and categorize content based on your preferences.
Returns a tf.experimental.Optional
with the next element of the iterator. (deprecated)
tf.data.experimental.get_next_as_optional(
iterator
)
If the iterator has reached the end of the sequence, the returned
tf.experimental.Optional
will have no value.
Returns |
A tf.experimental.Optional object which either contains the next element
of the iterator (if it exists) 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. Some content is licensed under the numpy license.
Last updated 2023-03-17 UTC.
[null,null,["Last updated 2023-03-17 UTC."],[],[],null,["# tf.data.experimental.get_next_as_optional\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.9.3/tensorflow/python/data/ops/iterator_ops.py#L936-L952) |\n\nReturns a [`tf.experimental.Optional`](../../../tf/experimental/Optional) with the next element of the iterator. (deprecated)\n\n#### View aliases\n\n\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`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/get_next_as_optional)\n\n\u003cbr /\u003e\n\n tf.data.experimental.get_next_as_optional(\n iterator\n )\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.data.Iterator.get_next_as_optional()`](../../../tf/data/Iterator#get_next_as_optional) instead.\n\nIf the iterator has reached the end of the sequence, the returned\n[`tf.experimental.Optional`](../../../tf/experimental/Optional) will have no value.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|----------------------------------------------------|\n| `iterator` | A [`tf.data.Iterator`](../../../tf/data/Iterator). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A [`tf.experimental.Optional`](../../../tf/experimental/Optional) object which either contains the next element of the iterator (if it exists) or no value. ||\n\n\u003cbr /\u003e"]]