tfds.file_adapter.FileFormatAdapter

Class FileFormatAdapter

Defined in core/file_format_adapter.py.

Provides writing and reading methods for a file format.

Properties

filetype_suffix

Returns a str file type suffix (e.g. "csv").

Methods

dataset_from_filename

dataset_from_filename(filename)

Returns a tf.data.Dataset whose elements are dicts given a filename.

write_from_generator

write_from_generator(
    generator_fn,
    output_files
)

Write to files from generators_and_filenames.

Args:

  • generator_fn: returns generator yielding dictionaries of feature name to value.
  • output_files: list<str>, output files to write records to.