TensorFlow 1 version View source on GitHub

Creates a dataset that deterministically chooses elements from datasets.
    datasets, choice_dataset

For example, given the following datasets:

datasets = ["foo").repeat(),

# Define a dataset containing `[0, 1, 2, 0, 1, 2, 0, 1, 2]`.
choice_dataset =

result =, choice_dataset)

The elements of result will be:

"foo", "bar", "baz", "foo", "bar", "baz", "foo", "bar", "baz"



A dataset that interleaves elements from datasets according to the values of choice_dataset.


  • TypeError: If the datasets or choice_dataset arguments have the wrong type.