tf.compat.v1.data.make_one_shot_iterator  |  TensorFlow v2.16.1 (original) (raw)

tf.compat.v1.data.make_one_shot_iterator

Stay organized with collections Save and categorize content based on your preferences.

Creates an iterator for elements of dataset.

tf.compat.v1.data.make_one_shot_iterator(
    dataset: tf.compat.v1.data.Dataset
) -> Union[iterator_ops.Iterator, iterator_ops.OwnedIterator]

Migrate to TF2

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 viavalues = next(iterator).

Description

Used in the notebooks

Used in the tutorials
Exploring the TF-Hub CORD-19 Swivel Embeddings Graph-based Neural Structured Learning in TFX Preprocessing data with TensorFlow Transform
Args
dataset A tf.data.Dataset.
Returns
A tf.data.Iterator for elements of dataset.

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 2024-04-26 UTC.