tensorflow-records-0.1.0.0: Encoder and decoder for the TensorFlow \"TFRecords\" format.

Safe HaskellNone
LanguageHaskell2010

TensorFlow.Records

Contents

Description

Encoder and decoder for the TensorFlow "TFRecords" format.

Synopsis

Records

putTFRecord :: ByteString -> Put

Put one TFRecord with the given contents.

getTFRecord :: Get ByteString

Parse one TFRecord.

getTFRecords :: Get [ByteString]

Parse many TFRecords as a list. Note you probably want streaming instead as provided by the tensorflow-records-conduit package.

Implementation

These may be useful for encoding or decoding to types other than ByteString that have their own Cereal codecs.

getTFRecordLength :: Get Word64

Get a length and verify its checksum.

getTFRecordData :: Word64 -> Get ByteString

Get a record payload and verify its checksum.

putTFRecordLength :: Word64 -> Put

Put a record length and its checksum.

putTFRecordData :: ByteString -> Put

Put a record payload and its checksum.