class ray.data.datasource.TFRecordDatasource[source]#

Bases: ray.data.datasource.file_based_datasource.FileBasedDatasource

TFRecord datasource, for reading and writing TFRecord files.

PublicAPI (alpha): This API is in alpha and may change before becoming stable.



do_write(blocks, metadata, ray_remote_args, ...)

Launch Ray tasks for writing blocks out to the datasource.


Return a human-readable name for this datasource.

on_write_complete(write_results, **kwargs)

Callback for when a write job completes.

on_write_failed(write_results, error, **kwargs)

Callback for when a write job fails.

prepare_read(parallelism, **read_args)

Deprecated: Please implement create_reader() instead.

write(blocks, ctx, path, dataset_uuid[, ...])

Write blocks for a file-based datasource.