MCPcopy Create free account
hub / github.com/OAID/Tengine / AllChildVisited

Function AllChildVisited

core/lib/graph.cpp:736–752  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736static bool AllChildVisited(Graph* graph, Node* node, std::vector<int>& visited, const std::set<Node*>& in_graph)
737{
738 for(unsigned int i = 0; i < node->GetOutputNum(); i++)
739 {
740 NodePort* port = node->GetOutputPort(i);
741 Tensor* tensor = port->tensor;
742
743 for(unsigned int k = 0; k < tensor->consumer.size(); k++)
744 {
745 NodePort* in_port = tensor->consumer[k];
746 Node* child = in_port->owner;
747 if(in_graph.count(child) && !visited[child->GetNodeIndex()])
748 return false;
749 }
750 }
751 return true;
752}
753
754static bool AllInputVisited(Graph* graph, Node* node, std::vector<int>& visited, const std::set<Node*>& in_graph)
755{

Callers 1

BackwardBFSMethod · 0.85

Calls 4

GetOutputPortMethod · 0.80
GetNodeIndexMethod · 0.80
GetOutputNumMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected