Zha0q1 commented on a change in pull request #15210: [WIP] Custom Operator 
Profiling Enhancement
URL: https://github.com/apache/incubator-mxnet/pull/15210#discussion_r292768811
 
 

 ##########
 File path: src/engine/threaded_engine.cc
 ##########
 @@ -333,9 +333,11 @@ void ThreadedEngine::PushAsync(AsyncFn fn, Context 
exec_ctx,
         << device_count_;
   }
 #endif
-  ThreadedOpr *opr = NewOperator(std::move(fn), const_vars, mutable_vars, 
prop, opr_name, wait);
-  opr->temporary = true;
   const bool profiling = 
profiler_->IsProfiling(profiler::Profiler::kImperative);
+       const char* d_name = profiling ? 
profiler::CustomOpProfiler::Get()->GetDisplayName(opr_name) : NULL;
+       const char* display_name = d_name ? d_name : opr_name;
 
 Review comment:
   There is a good reason for using chat*. Because display_name is passed to 
the next function (which takes a char*), we would want to avoid using a local 
variable here so that we are not pointing to destrcuted data in the future.

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


With regards,
Apache Git Services

Reply via email to