tf.contrib.eager.Iterator
Stay organized with collections
Save and categorize content based on your preferences.
An iterator producing tf.Tensor objects from a tf.data.Dataset.
tf.contrib.eager.Iterator(
dataset
)
Raises |
TypeError
|
If dataset is an unsupported type.
|
RuntimeError
|
When invoked without eager execution enabled.
|
Attributes |
element_spec
|
The type specification of an element of this iterator.
|
output_classes
|
Returns the class of each component of an element of this iterator. (deprecated)
The expected values are tf.Tensor and tf.SparseTensor .
|
output_shapes
|
Returns the shape of each component of an element of this iterator. (deprecated)
|
output_types
|
Returns the type of each component of an element of this iterator. (deprecated) |
Methods
get_next
View source
get_next(
name=None
)
Returns a nested structure of tf.Tensor
s containing the next element.
Args |
name
|
(Optional.) A name for the created operation. Currently unused.
|
Returns |
A nested structure of tf.Tensor objects.
|
next
View source
next()
Returns a nested structure of Tensor
s containing the next element.
__iter__
View source
__iter__()
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.contrib.eager.Iterator\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/eager/python/datasets.py#L27-L75) |\n\nAn iterator producing tf.Tensor objects from a tf.data.Dataset. \n\n tf.contrib.eager.Iterator(\n dataset\n )\n\n| **Note:** Unlike the iterator created by the [`tf.data.Dataset.make_one_shot_iterator`](../../../tf/data/Dataset#make_one_shot_iterator) method, this class enables additional experimental functionality, such as prefetching to the GPU.\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) object. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|----------------|-----------------------------------------------|\n| `TypeError` | If `dataset` is an unsupported type. |\n| `RuntimeError` | When invoked without eager execution enabled. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `element_spec` | The type specification of an element of this iterator. |\n| `output_classes` | Returns the class of each component of an element of this iterator. (deprecated) \u003cbr /\u003e | **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.compat.v1.data.get_output_classes(iterator)`](../../../tf/data/get_output_classes). The expected values are [`tf.Tensor`](../../../tf/Tensor) and [`tf.SparseTensor`](../../../tf/sparse/SparseTensor). |\n| `output_shapes` | Returns the shape of each component of an element of this iterator. (deprecated) \u003cbr /\u003e | **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.compat.v1.data.get_output_shapes(iterator)`](../../../tf/data/get_output_shapes). |\n| `output_types` | Returns the type of each component of an element of this iterator. (deprecated)**Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.compat.v1.data.get_output_types(iterator)`](../../../tf/data/get_output_types). |\n\nMethods\n-------\n\n### `get_next`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/ops/iterator_ops.py#L724-L737) \n\n get_next(\n name=None\n )\n\nReturns a nested structure of [`tf.Tensor`](../../../tf/Tensor)s containing the next element.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|--------|-----------------------------------------------------------------|\n| `name` | (Optional.) A name for the created operation. Currently unused. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A nested structure of [`tf.Tensor`](../../../tf/Tensor) objects. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|---|---|\n| [`tf.errors.OutOfRangeError`](../../../tf/errors/OutOfRangeError): If the end of the dataset has been reached. ||\n\n\u003cbr /\u003e\n\n### `next`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/ops/iterator_ops.py#L663-L668) \n\n next()\n\nReturns a nested structure of `Tensor`s containing the next element.\n\n### `__iter__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/data/ops/iterator_ops.py#L618-L619) \n\n __iter__()"]]