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

Method ParseLocalName

tensorflow/core/util/device_name_utils.cc:488–501  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

486
487/* static */
488bool DeviceNameUtils::ParseLocalName(StringPiece name, ParsedName* p) {
489 if (!ConsumeDeviceType(&name, &p->type)) {
490 return false;
491 }
492 p->has_type = true;
493 if (!absl::ConsumePrefix(&name, ":")) {
494 return false;
495 }
496 if (!ConsumeNumber(&name, &p->id)) {
497 return false;
498 }
499 p->has_id = true;
500 return name.empty();
501}
502
503/* static */
504bool DeviceNameUtils::SplitDeviceName(StringPiece name, string* task,

Callers

nothing calls this directly

Calls 4

ConsumeDeviceTypeFunction · 0.85
ConsumeNumberFunction · 0.85
ConsumePrefixFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected