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

Method ConstructNodeDef

tensorflow/core/graph/star_server_graph_partition.cc:210–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210Status GraphPartitionerBase::ConstructNodeDef(const Node* node, NodeDef *node_def) {
211 *node_def = node->def();
212 node_def->set_device(node->assigned_device_name());
213 node_def->clear_input();
214
215 int num_inputs = 0;
216 std::vector<const Edge*> inputs;
217 inputs.resize(node->num_inputs(), nullptr);
218 for (const Edge* in_edge : node->in_edges()) {
219 if (in_edge->IsControlEdge()) {
220 inputs.push_back(in_edge);
221 } else {
222 num_inputs++;
223 inputs[in_edge->dst_input()] = in_edge;
224 }
225 }
226
227 if (num_inputs != node->num_inputs()) {
228 return errors::InvalidArgument("Incomplete graph, missing ",
229 (node->num_inputs() - num_inputs),
230 " inputs for ", node->def().DebugString());
231 }
232
233 for (const Edge* in_edge : inputs) {
234 if (in_edge->src()->IsSource()) {
235 continue;
236 }
237 AddInput(node_def, in_edge->src()->name(), in_edge->src_output());
238 }
239
240 return Status::OK();
241}
242
243Status GraphPartitionerBase::ConstructRecvNodeDef(
244 const PartitionOptions &opts,

Callers

nothing calls this directly

Calls 13

InvalidArgumentFunction · 0.85
IsSourceMethod · 0.80
AddInputFunction · 0.70
nameMethod · 0.65
set_deviceMethod · 0.45
resizeMethod · 0.45
num_inputsMethod · 0.45
IsControlEdgeMethod · 0.45
push_backMethod · 0.45
dst_inputMethod · 0.45
DebugStringMethod · 0.45
srcMethod · 0.45

Tested by

no test coverage detected