Package org.apache.beam.sdk.io
Class TFRecordIO
java.lang.Object
org.apache.beam.sdk.io.TFRecordIO
PTransforms for reading and writing TensorFlow TFRecord files.
For reading files, use read().
For simple cases of writing files, use write(). For more complex cases (such as ability
to write windowed data or writing to multiple destinations) use sink() in combination with
FileIO.write() or FileIO.writeDynamic().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDeprecated.static classImplementation ofread().static classImplementation ofreadFiles().static classstatic classImplementation ofwrite(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Coder<byte[]> The default coder, which returns each record of the input file as a byte array. -
Method Summary
Modifier and TypeMethodDescriptionstatic TFRecordIO.Readread()APTransformthat reads from a TFRecord file (or multiple TFRecord files matching a pattern) and returns aPCollectioncontaining the decoding of each of the records of the TFRecord file(s) as a byte array.static TFRecordIO.ReadFilesLikeread(), but reads each file in aPCollectionofFileIO.ReadableFile, returned byFileIO.readMatches().static TFRecordIO.Sinksink()static TFRecordIO.Writewrite()APTransformthat writes aPCollectionto TFRecord file (or multiple TFRecord files matching a sharding pattern), with each element of the input collection encoded into its own record.
-
Field Details
-
DEFAULT_BYTE_ARRAY_CODER
The default coder, which returns each record of the input file as a byte array.
-
-
Method Details
-
read
APTransformthat reads from a TFRecord file (or multiple TFRecord files matching a pattern) and returns aPCollectioncontaining the decoding of each of the records of the TFRecord file(s) as a byte array. -
readFiles
Likeread(), but reads each file in aPCollectionofFileIO.ReadableFile, returned byFileIO.readMatches(). -
write
APTransformthat writes aPCollectionto TFRecord file (or multiple TFRecord files matching a sharding pattern), with each element of the input collection encoded into its own record. -
sink
-
Compression.