Function Reference

Creating Datasets

text_line_dataset()

A dataset comprising lines from one or more text files.

tfrecord_dataset()

A dataset comprising records from one or more TFRecord files.

sql_record_spec() sql_dataset() sqlite_dataset()

A dataset consisting of the results from a SQL query

tensors_dataset()

Creates a dataset with a single element, comprising the given tensors.

tensor_slices_dataset()

Creates a dataset whose elements are slices of the given tensors.

sparse_tensor_slices_dataset()

Splits each rank-N tf$SparseTensor in this dataset row-wise.

fixed_length_record_dataset()

A dataset of fixed-length records from one or more binary files.

file_list_dataset()

A dataset of all files matching a pattern

range_dataset()

Creates a dataset of a step-separated range of values.

read_files()

Read a dataset from a set of files

delim_record_spec() csv_record_spec() tsv_record_spec()

Specification for reading a record from a text file with delimited values

Transforming Datasets

dataset_map()

Map a function across a dataset.

dataset_prepare()

Prepare a dataset for analysis

dataset_skip()

Creates a dataset that skips count elements from this dataset

dataset_filter()

Filter a dataset by a predicate

dataset_shard()

Creates a dataset that includes only 1 / num_shards of this dataset.

dataset_shuffle()

Randomly shuffles the elements of this dataset.

dataset_prefetch()

Creates a Dataset that prefetches elements from this dataset.

dataset_batch()

Combines consecutive elements of this dataset into batches.

dataset_repeat()

Repeats a dataset count times.

dataset_cache()

Caches the elements in this dataset.

dataset_take()

Creates a dataset with at most count elements from this dataset

dataset_flat_map()

Maps map_func across this dataset and flattens the result.

dataset_padded_batch()

Combines consecutive elements of this dataset into padded batches

dataset_decode_delim()

Transform a dataset with delimted text lines into a dataset with named columns

dataset_concatenate()

Creates a dataset by concatenating given dataset with this dataset.

dataset_interleave()

Maps map_func across this dataset, and interleaves the results

zip_datasets()

Creates a dataset by zipping together the given datasets.

Dataset Properites

output_types() output_shapes()

Output types and shapes

Dataset Iterators

input_fn.tf_dataset()

Construct a tfestimators input function from a dataset

make_iterator_one_shot() make_iterator_initializable() make_iterator_from_structure() make_iterator_from_string_handle()

Creates an iterator for enumerating the elements of this dataset.

iterator_get_next()

Get next element from iterator

iterator_initializer()

An operation that should be run to initialize this iterator.

iterator_string_handle()

String-valued tensor that represents this iterator

iterator_make_initializer()

Create an operation that can be run to initialize this iterator

out_of_range_handler()

Handle out of range errors on dataset iterators