yuxihu commented on a change in pull request #13922: Support populating errors 
back to MXNet engine in callback
URL: https://github.com/apache/incubator-mxnet/pull/13922#discussion_r249122732
 
 

 ##########
 File path: src/engine/threaded_engine.cc
 ##########
 @@ -478,10 +478,14 @@ inline void ThreadedEngine::ThrowException(ThreadedVar* 
threaded_var) {
   return;
 }
 
-void ThreadedEngine::OnCompleteStatic(
-    Engine *engine, void *opr_block_) {
+void ThreadedEngine::OnCompleteStatic(Engine *engine, void *opr_block_,
+                                      const dmlc::Error* error) {
   OprBlock *opr_block = static_cast<OprBlock*>(opr_block_);
   ThreadedOpr *threaded_opr = opr_block->opr;
+  if (error != nullptr) {
+    auto ex_p = std::make_exception_ptr(*error);
+    threaded_opr->opr_exception = std::make_shared<std::exception_ptr>(ex_p);
 
 Review comment:
   Good catch. I will change related sites by removing the redundant shared_ptr 
in a separate PR.

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