leezu commented on a change in pull request #20262:
URL: https://github.com/apache/incubator-mxnet/pull/20262#discussion_r647723370



##########
File path: src/imperative/imperative.cc
##########
@@ -350,6 +350,15 @@ nnvm::Symbol Imperative::GetDeferredComputeSymbol(const 
std::vector<NDArray *> &
         << "must have a deferred compute history associated with them.";
     s.outputs.emplace_back(ndoutput->deferredcompute_entry_);
   }
+  nnvm::DFSVisit(s.outputs, [&](const nnvm::ObjectPtr& n) {

Review comment:
       I think this needs to run on a copy of the graph, because in general 
there can still be a call to `Compute` after `GetDeferredComputeSymbol`. 




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to