Package org.apache.beam.sdk.io
Class TFRecordIO
java.lang.Object
org.apache.beam.sdk.io.TFRecordIO
PTransform
s 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 enum
Deprecated.static class
Implementation ofread()
.static class
Implementation ofreadFiles()
.static class
static class
Implementation 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.Read
read()
APTransform
that reads from a TFRecord file (or multiple TFRecord files matching a pattern) and returns aPCollection
containing the decoding of each of the records of the TFRecord file(s) as a byte array.static TFRecordIO.ReadFiles
Likeread()
, but reads each file in aPCollection
ofFileIO.ReadableFile
, returned byFileIO.readMatches()
.static TFRecordIO.Sink
sink()
static TFRecordIO.Write
write()
APTransform
that writes aPCollection
to 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
APTransform
that reads from a TFRecord file (or multiple TFRecord files matching a pattern) and returns aPCollection
containing the decoding of each of the records of the TFRecord file(s) as a byte array. -
readFiles
Likeread()
, but reads each file in aPCollection
ofFileIO.ReadableFile
, returned byFileIO.readMatches()
. -
write
APTransform
that writes aPCollection
to TFRecord file (or multiple TFRecord files matching a sharding pattern), with each element of the input collection encoded into its own record. -
sink
-
Compression
.