zheng-da commented on a change in pull request #12184: Fix a bug in CachedOP.
URL: https://github.com/apache/incubator-mxnet/pull/12184#discussion_r210377856
 
 

 ##########
 File path: src/imperative/cached_op.cc
 ##########
 @@ -823,9 +823,10 @@ OpStatePtr CachedOp::DynamicForward(
 
   // If we are already recording, we don't need RunGraph to record all
   // computation again.
+  if (recording && !inlining_) recording = false;
   RunGraph(false, idx, arrays, 0, idx.num_nodes(), std::move(array_reqs),
            std::move(ref_count), &states, dispatch_modes,
-           !recording || inlining_);
+           recording);
 
 Review comment:
   i'm trying to follow the logic of the original code. A little logic error 
can cause unexpected problems.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to