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

Method AddRegularFaninInternal

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

Source from the content-addressed store, hash-verified

1047}
1048
1049inline void MutableGraphView::AddRegularFaninInternal(
1050 MutableNodeView* node_view, const SafeTensorId& fanin_id) {
1051 MutableNodeView* fanin_node_view = GetNode(fanin_id.node());
1052 // Resize fanouts to include new output port index.
1053 if (fanin_node_view->regular_fanouts_by_port_.size() < fanin_id.index() + 1) {
1054 fanin_node_view->regular_fanouts_by_port_.resize(fanin_id.index() + 1);
1055 }
1056
1057 // Add node as fanout to fanin.
1058 auto& fanouts = fanin_node_view->regular_fanouts_by_port_[fanin_id.index()];
1059 fanouts.emplace_back(this, node_view->node_index(),
1060 node_view->regular_fanins_.size(),
1061 node_view->regular_fanins_.size());
1062 ++fanin_node_view->num_regular_fanouts_;
1063
1064 // Add fanin to node.
1065 node_view->regular_fanins_.emplace_back(this, fanin_node_view->node_index(),
1066 fanin_id.index(), fanouts.size() - 1);
1067 IncrementFaninCount(
1068 &node_view->fanins_count_,
1069 {&graph_->node(fanin_node_view->node_index()), fanin_id.index()});
1070}
1071
1072inline void MutableGraphView::UpdateRegularFaninInternal(
1073 MutableNodeView* node_view, const int i, const SafeTensorId& fanin_id) {

Callers

nothing calls this directly

Calls 7

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