| 208 | } |
| 209 | |
| 210 | Status 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 | |
| 243 | Status GraphPartitionerBase::ConstructRecvNodeDef( |
| 244 | const PartitionOptions &opts, |
nothing calls this directly
no test coverage detected