TODO(lyandy): Checks for self loops, Switch control dependencies, fanins exist, and all regular fanins come before controlling fanins.
| 335 | // TODO(lyandy): Checks for self loops, Switch control dependencies, fanins |
| 336 | // exist, and all regular fanins come before controlling fanins. |
| 337 | void AddFanouts(NodeDefT* node) { |
| 338 | int max_input_port = -1; |
| 339 | for (int i = 0; i < node->input_size(); ++i) { |
| 340 | TensorId tensor_id = ParseTensorName(node->input(i)); |
| 341 | OutputPort output(nodes_[tensor_id.node()], tensor_id.index()); |
| 342 | |
| 343 | if (output.port_id < 0) { |
| 344 | fanouts_[output].emplace(node, -1); |
| 345 | } else { |
| 346 | max_input_port = i; |
| 347 | max_regular_output_port_[output.node] = |
| 348 | std::max(max_regular_output_port_[output.node], output.port_id); |
| 349 | fanouts_[output].emplace(node, i); |
| 350 | } |
| 351 | } |
| 352 | if (max_input_port > -1) { |
| 353 | max_regular_input_port_[node] = max_input_port; |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | // Access to the mutable internal state for MutableGraphView. |
| 358 | absl::flat_hash_map<absl::string_view, NodeDefT*>& nodes() { return nodes_; } |
nothing calls this directly
no test coverage detected