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

Function ParseFeatures

tensorflow/core/util/example_proto_fast_parsing.cc:338–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338bool ParseFeatures(protobuf::io::CodedInputStream* stream,
339 parsed::Example* example) {
340 DCHECK(stream != nullptr);
341 DCHECK(example != nullptr);
342 uint32 length;
343 if (!stream->ReadVarint32(&length)) return false;
344 auto limit = stream->PushLimit(length);
345 while (!stream->ExpectAtEnd()) {
346 parsed::FeatureMapEntry feature_map_entry;
347 if (!stream->ExpectTag(kDelimitedTag(1))) return false;
348 if (!ParseFeatureMapEntry(stream, &feature_map_entry)) return false;
349 example->push_back(std::move(feature_map_entry));
350 }
351 stream->PopLimit(limit);
352 return true;
353}
354
355bool ParseExample(protobuf::io::CodedInputStream* stream,
356 parsed::Example* example) {

Callers 1

ParseExampleFunction · 0.85

Calls 4

kDelimitedTagFunction · 0.85
ParseFeatureMapEntryFunction · 0.85
ReadVarint32Method · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected