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

Function DeviceName

tensorflow/core/graph/graph_partition_test.cc:75–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75string DeviceName(const Node* node) {
76 char first = node->name()[0];
77 if (first == 'G') {
78 return gpu_device;
79 } else {
80 const string cpu_prefix = "/job:a/replica:0/task:0/cpu:";
81 int index = first - 'A';
82 return strings::StrCat(cpu_prefix, index);
83 }
84}
85
86void Partition(const GraphDef& graph_def,
87 std::unordered_map<string, GraphDef>* partitions) {

Callers 4

PartitionFunction · 0.70
InitMethod · 0.50
CreateSendRecvMethod · 0.50

Calls 2

nameMethod · 0.65
StrCatFunction · 0.50

Tested by

no test coverage detected