| 1070 | } |
| 1071 | |
| 1072 | inline void MutableGraphView::UpdateRegularFaninInternal( |
| 1073 | MutableNodeView* node_view, const int i, const SafeTensorId& fanin_id) { |
| 1074 | // Remove fanin. |
| 1075 | RemoveRegularFaninFanoutInternal(node_view, i); |
| 1076 | |
| 1077 | MutableNodeView* fanin_node_view = GetNode(fanin_id.node()); |
| 1078 | // Resize fanouts to include new output port index. |
| 1079 | if (fanin_node_view->regular_fanouts_by_port_.size() < fanin_id.index() + 1) { |
| 1080 | fanin_node_view->regular_fanouts_by_port_.resize(fanin_id.index() + 1); |
| 1081 | } |
| 1082 | |
| 1083 | // Add node as fanout to fanin. |
| 1084 | auto& fanouts = fanin_node_view->regular_fanouts_by_port_[fanin_id.index()]; |
| 1085 | fanouts.emplace_back(this, node_view->node_index(), i, i); |
| 1086 | ++fanin_node_view->num_regular_fanouts_; |
| 1087 | |
| 1088 | // Replace fanin in node. |
| 1089 | node_view->regular_fanins_[i] = |
| 1090 | MutableFanoutView(this, fanin_node_view->node_index(), fanin_id.index(), |
| 1091 | fanouts.size() - 1); |
| 1092 | IncrementFaninCount( |
| 1093 | &node_view->fanins_count_, |
| 1094 | {&graph_->node(fanin_node_view->node_index()), fanin_id.index()}); |
| 1095 | } |
| 1096 | |
| 1097 | inline void MutableGraphView::RemoveControllingFaninFanoutInternal( |
| 1098 | MutableNodeView* node_view, int i) { |
nothing calls this directly
no test coverage detected