Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

Module: tfds.file_adapter

View source on GitHub

tfds.file_adapter.FileFormatAdapters for GeneratorBasedBuilder.

FileFormatAdapters implement methods to write and read data from a particular file format.

Currently, a single FileAdapter is available:

  • TFRecordExampleAdapter: To store the pre-processed dataset as .tfrecord file
return TFRecordExampleAdapter({
    "x": tf.io.FixedLenFeature(tuple(), tf.int64)


class FileFormatAdapter: Provides writing and reading methods for a file format.

class TFRecordExampleAdapter: Writes/Reads serialized Examples protos to/from TFRecord files.