You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/07/20 20:34:08 UTC

[GitHub] [incubator-mxnet] ptrendx commented on a change in pull request #20462: [BUGFIX] Fix #20293

ptrendx commented on a change in pull request #20462:
URL: https://github.com/apache/incubator-mxnet/pull/20462#discussion_r673472678



##########
File path: src/imperative/cached_op.cc
##########
@@ -989,7 +991,12 @@ void CachedOp::StaticBackward(
       auto entry = state.info.grad_graph.outputs[iter->second];
       if (!idx.exist(entry.node.get())) continue;
       auto eid = idx.entry_id(entry);
-      state.array_reqs[eid] = reqs[iter->second];
+      // if ref count is not 0, then we should not assign req user provide
+      if (reqs[iter->second] == kNullOp && !(ref_count[eid] == 0)) {
+        state.array_reqs[eid] = kWriteTo;

Review comment:
       A question, since I do not really know - do we need to put `kWriteTo` here? I think it should be handled by the memory pass later on, right?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org