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

Method GetFanouts

tensorflow/core/grappler/graph_view.h:206–224  ·  view source on GitHub ↗

Gets all the input ports in the immediate fanout of a node. Include the controlled nodes iff include_controlled_nodes is true.

Source from the content-addressed store, hash-verified

204 // Gets all the input ports in the immediate fanout of a node. Include the
205 // controlled nodes iff include_controlled_nodes is true.
206 absl::flat_hash_set<InputPort> GetFanouts(
207 const NodeDefT& node, bool include_controlled_nodes) const {
208 absl::flat_hash_set<InputPort> result;
209
210 OutputPort port;
211 port.node = const_cast<NodeDefT*>(&node);
212 const int first_port_id = include_controlled_nodes ? -1 : 0;
213 const int last_port_id =
214 gtl::FindWithDefault(max_regular_output_port_, &node, -1);
215
216 for (int i = first_port_id; i <= last_port_id; ++i) {
217 port.port_id = i;
218 auto it = fanouts_.find(port);
219 if (it != fanouts_.end()) {
220 result.insert(it->second.begin(), it->second.end());
221 }
222 }
223 return result;
224 }
225
226 // Gets all the output ports in the immediate fanin of a node. Include the
227 // controlling nodes iff include_controlling_nodes is true.

Callers 8

TEST_FFunction · 0.80
BM_GraphViewGetFanoutsFunction · 0.80
CompareNodeFanoutsFunction · 0.80
CheckGraphFunction · 0.80
RemoveDeadBranchesMethod · 0.80
OptimizeMethod · 0.80
PropagateShapesMethod · 0.80
InferStaticallyMethod · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by 4

TEST_FFunction · 0.64
BM_GraphViewGetFanoutsFunction · 0.64
CompareNodeFanoutsFunction · 0.64
CheckGraphFunction · 0.64