tf.python_io.TFRecordWriter

class tf.python_io.TFRecordWriter

See the guide: Data IO (Python functions)

A class to write records to a TFRecords file.

This class implements __enter__ and __exit__, and can be used in with blocks like a normal file.

Methods

__init__(path, options=None)

Opens file path and creates a TFRecordWriter writing to it.

Args:

  • path: The path to the TFRecords file.
  • options: (optional) A TFRecordOptions object.

Raises:

  • IOError: If path cannot be opened for writing.

close()

Close the file.

write(record)

Write a string record to the file.

Args:

  • record: str

Defined in tensorflow/python/lib/io/tf_record.py.