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

Method RemoveFaninsInternal

tensorflow/core/grappler/mutable_graph_view.cc:1592–1614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1590}
1591
1592void 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
1616void MutableGraphView::RemoveFanoutsInternal(NodeDef* deleted_node) {
1617 const int max_port =

Callers

nothing calls this directly

Calls 9

ParseTensorNameFunction · 0.85
IsTensorIdControllingFunction · 0.85
input_sizeMethod · 0.45
inputMethod · 0.45
nodeMethod · 0.45
indexMethod · 0.45
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected