piiswrong commented on a change in pull request #10451: [MXNET-432] Add Foreach
URL: https://github.com/apache/incubator-mxnet/pull/10451#discussion_r189703732
 
 

 ##########
 File path: src/imperative/imperative_utils.h
 ##########
 @@ -379,7 +379,8 @@ inline void PushFCompute(const FCompute& fn,
                              &input_blobs, &output_blobs, &pre_temp_src, 
&pre_temp_dst,
                              &post_temp_src, &post_temp_dst, &in_temp_idx_map, 
mutate_idx);
       // setup context
-      OpContext opctx{is_train, rctx, engine::CallbackOnComplete(), requested};
+      bool need_grad = Imperative::Get()->is_recording();
 
 Review comment:
   need_grad shouldn't be get from the worker thread. It should be set outside 
similar to is_train

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to