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

Method NumFanouts

tensorflow/core/grappler/graph_view.h:255–271  ·  view source on GitHub ↗

Gets the number of ports in the immediate fanout of a node. Count the controlled nodes iff include_controlled_nodes is true.

Source from the content-addressed store, hash-verified

253 // Gets the number of ports in the immediate fanout of a node. Count the
254 // controlled nodes iff include_controlled_nodes is true.
255 int NumFanouts(const NodeDefT& node, bool include_controlled_nodes) const {
256 int count = 0;
257
258 OutputPort port;
259 port.node = const_cast<NodeDefT*>(&node);
260 const int first_port_id = include_controlled_nodes ? -1 : 0;
261 const int last_port_id =
262 gtl::FindWithDefault(max_regular_output_port_, &node, -1);
263
264 for (int i = first_port_id; i <= last_port_id; ++i) {
265 port.port_id = i;
266 auto it = fanouts_.find(port);
267 if (it != fanouts_.end()) count += it->second.size();
268 }
269
270 return count;
271 }
272
273 // Gets all the edges in the immediate fanout of a node. Include the
274 // controlled edges iff include_controlled_edges is true.

Callers 1

TEST_FFunction · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64