@@ -31,22 +31,6 @@ def parse_avro(serialized, reader_schema, features, avro_names=None, name=None):
31
31
"""
32
32
Parses `avro` records into a `dict` of tensors.
33
33
34
- :param serialized: The batched, serialized string tensors.
35
- :param reader_schema: The reader schema. Note, this MUST match the reader
36
- schema from the avro_record_dataset. Otherwise,
37
- this op will segfault!
38
- :param features: A map of feature names mapped to feature
39
- information.
40
- :param avro_names: (Optional.) may contain descriptive names
41
- for the corresponding serialized avro parts. These may
42
- be useful for debugging purposes, but they have no
43
- effect on the output. If not `None`, `avro_names`
44
- must be the same length as `serialized`.
45
-
46
- :param name: The name of the op.
47
-
48
- :return: A map of feature names to tensors.
49
-
50
34
This op parses serialized avro records into a dictionary mapping keys to
51
35
`Tensor`, and `SparseTensor` objects. `features` is a dict from keys to
52
36
`VarLenFeature`, `SparseFeature`, `RaggedFeature`, and `FixedLenFeature`
@@ -79,6 +63,24 @@ def parse_avro(serialized, reader_schema, features, avro_names=None, name=None):
79
63
Use this within the dataset.map(parser_fn=parse_avro).
80
64
81
65
Only works for batched serialized input!
66
+
67
+ Args:
68
+ serialized: The batched, serialized string tensors.
69
+
70
+ reader_schema: The reader schema. Note, this MUST match the reader schema
71
+ from the avro_record_dataset. Otherwise, this op will segfault!
72
+
73
+ features: A map of feature names mapped to feature information.
74
+
75
+ avro_names: (Optional.) may contain descriptive names for the
76
+ corresponding serialized avro parts. These may be useful for debugging
77
+ purposes, but they have no effect on the output. If not `None`,
78
+ `avro_names` must be the same length as `serialized`.
79
+
80
+ name: The name of the op.
81
+
82
+ Returns:
83
+ A map of feature names to tensors.
82
84
"""
83
85
if not features :
84
86
raise ValueError ("Missing: features was %s." % features )
0 commit comments