| 1590 | } |
| 1591 | |
| 1592 | void MutableGraphView::RemoveFaninsInternal(NodeDef* deleted_node, |
| 1593 | bool keep_controlling_fanins) { |
| 1594 | for (int i = 0; i < deleted_node->input_size(); ++i) { |
| 1595 | TensorId tensor_id = ParseTensorName(deleted_node->input(i)); |
| 1596 | bool is_control = IsTensorIdControlling(tensor_id); |
| 1597 | if (keep_controlling_fanins && is_control) { |
| 1598 | break; |
| 1599 | } |
| 1600 | OutputPort fanin(nodes()[tensor_id.node()], tensor_id.index()); |
| 1601 | |
| 1602 | InputPort input; |
| 1603 | input.node = deleted_node; |
| 1604 | input.port_id = is_control ? Graph::kControlSlot : i; |
| 1605 | |
| 1606 | auto it = fanouts().find(fanin); |
| 1607 | if (it != fanouts().end()) { |
| 1608 | absl::flat_hash_set<InputPort>* fanouts_set = &it->second; |
| 1609 | fanouts_set->erase(input); |
| 1610 | UpdateMaxRegularOutputPortForRemovedFanin(fanin, *fanouts_set); |
| 1611 | } |
| 1612 | } |
| 1613 | max_regular_input_port().erase(deleted_node); |
| 1614 | } |
| 1615 | |
| 1616 | void MutableGraphView::RemoveFanoutsInternal(NodeDef* deleted_node) { |
| 1617 | const int max_port = |
nothing calls this directly
no test coverage detected