TensorFlow 1 version View source on GitHub

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.

path The path to the TFRecords file.
options (optional) String specifying compression type, TFRecordCompressionType, or TFRecordOptions object.

IOError If path cannot be opened for writing.
ValueError If valid compression_type can't be determined from options.



View source

Close the file.


View source

Flush the file.


View source

Write a string record to the file.

record str


View source

Enter a with block.


View source

Exit a with block, closing the file.