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

Method GetFanins

tensorflow/core/grappler/graph_view.h:228–242  ·  view source on GitHub ↗

Gets all the output ports in the immediate fanin of a node. Include the controlling nodes iff include_controlling_nodes is true.

Source from the content-addressed store, hash-verified

226 // Gets all the output ports in the immediate fanin of a node. Include the
227 // controlling nodes iff include_controlling_nodes is true.
228 absl::flat_hash_set<OutputPort> GetFanins(
229 const NodeDefT& node, bool include_controlling_nodes) const {
230 absl::flat_hash_set<OutputPort> result;
231 const int max_input_port =
232 include_controlling_nodes
233 ? node.input_size() - 1
234 : gtl::FindWithDefault(max_regular_input_port_, &node, -1);
235 for (int i = 0; i <= max_input_port; ++i) {
236 TensorId tensor_id = ParseTensorName(node.input(i));
237
238 auto it = nodes_.find(tensor_id.node());
239 if (it != nodes_.end()) result.emplace(it->second, tensor_id.index());
240 }
241 return result;
242 }
243
244 // Gets the number of ports in the immediate fanin of a node. Count the
245 // controlling nodes iff include_controlling_nodes is true.

Callers 8

TEST_FFunction · 0.80
BM_GraphViewGetFaninsFunction · 0.80
CheckGraphFunction · 0.80
SchedulingPassFunction · 0.80
IsNodeHostCandidateFunction · 0.80
RemoveShuffleDatasetFunction · 0.80
RemoveShuffleDatasetV2Function · 0.80

Calls 8

ParseTensorNameFunction · 0.85
input_sizeMethod · 0.45
inputMethod · 0.45
findMethod · 0.45
nodeMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45
indexMethod · 0.45

Tested by 3

TEST_FFunction · 0.64
BM_GraphViewGetFaninsFunction · 0.64
CheckGraphFunction · 0.64