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

Function GetDeviceClass

tensorflow/core/grappler/costs/utils.cc:438–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438string GetDeviceClass(const string& device_name) {
439 // TODO(dyoon): channel device name follows the convention we currently have
440 // in VirtualScheduler. This should be revised with VirtualScheduler as well
441 // as VirtualPlacer in the future.
442 if (device_name.find("Channel") != string::npos) {
443 const string from = "_from_";
444 const string to = "_to_";
445 const auto from_loc = device_name.find(from);
446 const auto to_loc = device_name.find(to);
447 const auto src_device_full = device_name.substr(
448 from_loc + from.size(), to_loc - (from_loc + from.size()));
449 const auto dst_device_full = device_name.substr(to_loc + to.size());
450 return strings::StrCat(
451 "Channel", ": ", GetDeviceClassForNonChannelDevice(src_device_full),
452 " -> ", GetDeviceClassForNonChannelDevice(dst_device_full));
453 } else {
454 return GetDeviceClassForNonChannelDevice(device_name);
455 }
456}
457
458string GetStatsStringFromRunMetadata(const RunMetadata& run_metadata,
459 bool verbosity) {

Callers 2

TESTFunction · 0.85

Calls 4

StrCatFunction · 0.50
findMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.68