# NOTE: The following examples use `{ ... }` to represent the# contents of a dataset.a={1,2,3}b={(7,8),(9,10)}# The nested structure of the `datasets` argument determines the# structure of elements in the resulting dataset.a.apply(tf.data.experimental.enumerate_dataset(start=5))=> {(5,1),(6,2),(7,3)}b.apply(tf.data.experimental.enumerate_dataset())=> {(0,(7,8)),(1,(9,10))}
Args
start
A tf.int64 scalar tf.Tensor, representing the start value for
enumeration.
[[["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.data.experimental.enumerate_dataset\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/data/experimental/ops/enumerate_ops.py#L20-L54) |\n\nA transformation that enumerates the elements of a dataset. (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.enumerate_dataset`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/enumerate_dataset)\n\n\u003cbr /\u003e\n\n tf.data.experimental.enumerate_dataset(\n start=0\n )\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.data.Dataset.enumerate()`](../../../tf/data/Dataset#enumerate).\n\nIt is similar to python's `enumerate`.\nFor example: \n\n # NOTE: The following examples use `{ ... }` to represent the\n # contents of a dataset.\n a = { 1, 2, 3 }\n b = { (7, 8), (9, 10) }\n\n # The nested structure of the `datasets` argument determines the\n # structure of elements in the resulting dataset.\n a.apply(tf.data.experimental.enumerate_dataset(start=5))\n =\u003e { (5, 1), (6, 2), (7, 3) }\n b.apply(tf.data.experimental.enumerate_dataset())\n =\u003e { (0, (7, 8)), (1, (9, 10)) }\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|---------------------------------------------------------------------------------------------------------------------------|\n| `start` | A [`tf.int64`](../../../tf#int64) scalar [`tf.Tensor`](../../../tf/Tensor), representing the start value for enumeration. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](../../../tf/data/Dataset#apply). ||\n\n\u003cbr /\u003e"]]