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

Method UpdateRegularFaninInternal

tensorflow/core/grappler/utils/graph_view.cc:1072–1095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070}
1071
1072inline 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
1097inline void MutableGraphView::RemoveControllingFaninFanoutInternal(
1098 MutableNodeView* node_view, int i) {

Callers

nothing calls this directly

Calls 8

MutableFanoutViewClass · 0.85
IncrementFaninCountFunction · 0.85
nodeMethod · 0.45
sizeMethod · 0.45
indexMethod · 0.45
resizeMethod · 0.45
emplace_backMethod · 0.45
node_indexMethod · 0.45

Tested by

no test coverage detected