MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ParseExample

Function ParseExample

tensorflow/core/util/example_proto_fast_parsing.cc:355–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355bool ParseExample(protobuf::io::CodedInputStream* stream,
356 parsed::Example* example) {
357 DCHECK(stream != nullptr);
358 DCHECK(example != nullptr);
359 // Loop over the input stream which may contain multiple serialized Example
360 // protos merged together as strings. This behavior is consistent with Proto's
361 // ParseFromString when string representations are concatenated.
362 while (!stream->ExpectAtEnd()) {
363 if (!stream->ExpectTag(kDelimitedTag(1))) {
364 if (!SkipExtraneousTag(stream)) return false;
365 } else {
366 if (!ParseFeatures(stream, example)) return false;
367 }
368 }
369 return true;
370}
371
372bool ParseExample(StringPiece serialized, parsed::Example* example) {
373 DCHECK(example != nullptr);

Callers 3

TestFastParseFunction · 0.70
FastParseSingleExampleFunction · 0.70

Calls 6

kDelimitedTagFunction · 0.85
SkipExtraneousTagFunction · 0.85
ParseFeaturesFunction · 0.85
EnableAliasingFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

TestFastParseFunction · 0.56