This is a legacy API for consuming dataset elements and should only be used
during transition from TF 1 to TF 2. Note that using this API should be
a transient state of your code base as there are in general no guarantees
about the interoperability of TF 1 and TF 2 code.
In TF 2 datasets are Python iterables which means you can consume their
elements using for elem in dataset: ... or by explicitly creating iterator
via iterator = iter(dataset) and fetching its elements via
values = next(iterator).
(Optional.) If non-empty, the returned iterator will be shared
under the given name across multiple sessions that share the same devices
(e.g. when using a remote server).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.compat.v1.data.make_initializable_iterator\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/data/ops/dataset_ops.py#L4291-L4336) |\n\nCreates an iterator for elements of `dataset`. \n\n tf.compat.v1.data.make_initializable_iterator(\n dataset: ../../../../tf/compat/v1/data/Dataset,\n shared_name=None\n ) -\u003e ../../../../tf/compat/v1/data/Iterator\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nThis is a legacy API for consuming dataset elements and should only be used\nduring transition from TF 1 to TF 2. Note that using this API should be\na transient state of your code base as there are in general no guarantees\nabout the interoperability of TF 1 and TF 2 code.\n\nIn TF 2 datasets are Python iterables which means you can consume their\nelements using `for elem in dataset: ...` or by explicitly creating iterator\nvia `iterator = iter(dataset)` and fetching its elements via\n`values = next(iterator)`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n**Note:** The returned iterator will be in an uninitialized state, and you must run the `iterator.initializer` operation before using it: \n\n dataset = ...\n iterator = tf.compat.v1.data.make_initializable_iterator(dataset)\n # ...\n sess.run(iterator.initializer)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dataset` | A [`tf.data.Dataset`](../../../../tf/data/Dataset). |\n| `shared_name` | (Optional.) If non-empty, the returned iterator will be shared under the given name across multiple sessions that share the same devices (e.g. when using a remote server). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A [`tf.data.Iterator`](../../../../tf/data/Iterator) for elements of `dataset`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|----------------|--------------------------------|\n| `RuntimeError` | If eager execution is enabled. |\n\n\u003cbr /\u003e"]]