|
|
|
@ -201,7 +201,11 @@ void Cloner::CloneFuncGraphValueNodes(const FuncGraphPtr &func_graph, const Func
|
|
|
|
|
|
|
|
|
|
auto &cnodes = func_graph->func_graph_cnodes_index();
|
|
|
|
|
for (auto &cnode : cnodes) {
|
|
|
|
|
auto parent = cnode.first->first->cast<CNodePtr>();
|
|
|
|
|
auto parent = dyn_cast<CNode>(cnode.first->first.lock());
|
|
|
|
|
// cnode was free, so ignore the using info
|
|
|
|
|
if (parent == nullptr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
auto valuenode = parent->input(cnode.first->second);
|
|
|
|
|
CloneValueNode(valuenode, target_func_graph);
|
|
|
|
|
}
|
|
|
|
@ -415,7 +419,12 @@ void Cloner::LiftParameters(const FuncGraphPtr &func_graph_user, const FuncGraph
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
for (auto &cnode : func_graph_user->func_graph_cnodes_index()) {
|
|
|
|
|
LiftParameters(cnode.first->first->func_graph(), func_graph_user, lift_params);
|
|
|
|
|
auto anf_node = cnode.first->first.lock();
|
|
|
|
|
// cnode was free, so ignore the using info
|
|
|
|
|
if (anf_node == nullptr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
LiftParameters(anf_node->func_graph(), func_graph_user, lift_params);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -428,7 +437,12 @@ void Cloner::Lift() {
|
|
|
|
|
if (iter != repl_func_graph_params_.end()) {
|
|
|
|
|
auto ¶ms = iter->second;
|
|
|
|
|
for (auto &cnode : func_graph->func_graph_cnodes_index()) {
|
|
|
|
|
LiftParameters(cnode.first->first->func_graph(), func_graph, params);
|
|
|
|
|
auto anf_node = cnode.first->first.lock();
|
|
|
|
|
// cnode was free, so ignore the using info
|
|
|
|
|
if (anf_node == nullptr) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
LiftParameters(anf_node->func_graph(), func_graph, params);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|