You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by jx...@apache.org on 2018/08/17 19:20:37 UTC

[incubator-mxnet] branch master updated: Fix a bug in CachedOP. (#12184)

This is an automated email from the ASF dual-hosted git repository.

jxie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new cd9f9c8  Fix a bug in CachedOP. (#12184)
cd9f9c8 is described below

commit cd9f9c87a65caf2d3ac451066e05fb40f3db5e96
Author: Da Zheng <zh...@gmail.com>
AuthorDate: Fri Aug 17 12:20:27 2018 -0700

    Fix a bug in CachedOP. (#12184)
    
    * fix a bug.
    
    * address comments.
    
    * retrigger
    
    * address comments.
---
 src/imperative/cached_op.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/imperative/cached_op.cc b/src/imperative/cached_op.cc
index 1e7f8e0..0c4c1e6 100644
--- a/src/imperative/cached_op.cc
+++ b/src/imperative/cached_op.cc
@@ -821,11 +821,12 @@ OpStatePtr CachedOp::DynamicForward(
 
   const auto& dispatch_modes = g.GetAttr<DispatchModeVector>("dispatch_mode");
 
-  // If we are already recording, we don't need RunGraph to record all
-  // computation again.
+  // If CachedOp is running in the inline mode, it uses RunGraph to record
+  // computation; otherwise, CachedOp records computation itself.
+  // So if it's not the inline mode, we disable recording.
   RunGraph(false, idx, arrays, 0, idx.num_nodes(), std::move(array_reqs),
            std::move(ref_count), &states, dispatch_modes,
-           !recording || inlining_);
+           recording && inlining_);
 
   return op_state;
 }