Browse Source

do not remove parameter in updatestate

tags/v1.4.0
Margaret_wangrui 4 years ago
parent
commit
982df3a77e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      mindspore/ccsrc/backend/optimizer/pass/optimize_updatestate.cc

+ 2
- 1
mindspore/ccsrc/backend/optimizer/pass/optimize_updatestate.cc View File

@@ -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;
}


Loading…
Cancel
Save