larroy commented on a change in pull request #8737: Use RAII and fix Coverity 
resource leaks #10371 and others
URL: https://github.com/apache/incubator-mxnet/pull/8737#discussion_r152696303
 
 

 ##########
 File path: cpp-package/example/alexnet.cpp
 ##########
 @@ -215,7 +215,7 @@ int main(int argc, char const *argv[]) {
   args_map["label"] = NDArray(Shape(batch_size), ctx);
 
   /*with data and label, executor can be generated automatically*/
-  auto *exec = Net.SimpleBind(ctx, args_map);
+  auto exec = Net.SimpleBind(ctx, args_map);
 
 Review comment:
   Thanks. I will bring it up on the list. About shared_ptr: since you can 
create it yourself by moving from the unique_ptr if you need a shared_ptr, 
shouldn't be a big issue. Actually faster to not create a shared_ptr if not 
needed, as it doesn't need the atomic refcount machinery. 

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