|
|
@ -27,12 +27,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace ge {
|
|
|
|
namespace ge {
|
|
|
|
Status PrunePass::Run(ge::ComputeGraphPtr graph) {
|
|
|
|
Status PrunePass::Run(ge::ComputeGraphPtr graph) {
|
|
|
|
GELOGD("PrunePass Start");
|
|
|
|
GELOGD("PrunePass Start, graph is [%s]", graph->GetName().c_str());
|
|
|
|
if (graph == nullptr) {
|
|
|
|
if (graph == nullptr) {
|
|
|
|
GELOGE(GE_GRAPH_ISNULL, "input compute graph is NULL.");
|
|
|
|
GELOGE(GE_GRAPH_ISNULL, "input compute graph is NULL.");
|
|
|
|
return GE_GRAPH_ISNULL;
|
|
|
|
return GE_GRAPH_ISNULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<NodePtr> out_nodes;
|
|
|
|
std::vector<NodePtr> out_nodes;
|
|
|
|
std::unordered_set<NodePtr> nodes;
|
|
|
|
std::unordered_set<NodePtr> nodes;
|
|
|
|
for (NodePtr &node_ptr : graph->GetDirectNode()) {
|
|
|
|
for (NodePtr &node_ptr : graph->GetDirectNode()) {
|
|
|
@ -42,7 +41,6 @@ Status PrunePass::Run(ge::ComputeGraphPtr graph) {
|
|
|
|
out_nodes.push_back(node_ptr);
|
|
|
|
out_nodes.push_back(node_ptr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (out_nodes.empty()) {
|
|
|
|
if (out_nodes.empty()) {
|
|
|
|
GELOGW("graph [%s] does not contain NETOUTPUT type node,no return value. Do nothing!", graph->GetName().c_str());
|
|
|
|
GELOGW("graph [%s] does not contain NETOUTPUT type node,no return value. Do nothing!", graph->GetName().c_str());
|
|
|
|
return ge::SUCCESS;
|
|
|
|
return ge::SUCCESS;
|
|
|
|