tf.data.experimental.Counter

View source on GitHub

Creates a Dataset that counts from start in steps of size step.

tf.data.experimental.Counter(
    start=0, step=1, dtype=tf.dtypes.int64
)

For example:

Dataset.count() == [0, 1, 2, ...)
Dataset.count(2) == [2, 3, ...)
Dataset.count(2, 5) == [2, 7, 12, ...)
Dataset.count(0, -1) == [0, -1, -2, ...)
Dataset.count(10, -1) == [10, 9, ...)

Args:

Returns:

A Dataset of scalar dtype elements.