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

Method AddSharedNodes

tensorflow/core/grappler/optimizers/auto_parallel.cc:204–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void AutoParallel::AddSharedNodes(GraphDef* graph) {
205 string prefix = strings::StrCat(kAutoParallelPrefix, "-Replica-", 0);
206 for (const auto& node : shared_nodes_) {
207 auto new_node = graph->add_node();
208 *new_node = *all_nodes_[node];
209 for (int i = 0; i < new_node->input_size(); i++) {
210 if (NotSharedNode(NodeName(new_node->input(i)))) {
211 string new_name = AddPrefixToNodeName(new_node->input(i), prefix);
212 *new_node->mutable_input(i) = new_name;
213 }
214 }
215 }
216}
217
218void AutoParallel::AddOneReplica(GraphDef* graph, int number) {
219 string prefix = strings::StrCat(kAutoParallelPrefix, "-Replica-", number);

Callers

nothing calls this directly

Calls 6

NodeNameFunction · 0.85
AddPrefixToNodeNameFunction · 0.85
StrCatFunction · 0.50
input_sizeMethod · 0.45
inputMethod · 0.45
mutable_inputMethod · 0.45

Tested by

no test coverage detected