TensorFlow 2.0 Beta is available Learn more

Module: tfds.file_adapter

tfds.file_adapter.FileFormatAdapters for GeneratorBasedBuilder.

View source

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.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.