|
|
|
@@ -52,7 +52,8 @@ const AnfNodePtr OptimizeUpdateState::Process(const FuncGraphPtr &func_graph, co |
|
|
|
for (size_t i = kAdditionalAttachIndex; i < update_state->size(); ++i) { |
|
|
|
auto &attach = update_state->input(i); |
|
|
|
auto &users = node_users[attach]; |
|
|
|
if ((users.size() == 1) && (users.front().first == update_state)) { |
|
|
|
// In heterogeneous, parameters in subgraphs may only be used by UpdateState and should not be eliminated. |
|
|
|
if ((users.size() == 1) && (users.front().first == update_state) && !attach->isa<Parameter>()) { |
|
|
|
// If the only user of attach is the UpdateState node, drop the attach node. |
|
|
|
continue; |
|
|
|
} |
|
|
|
|