You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/05/20 20:23:59 UTC

[GitHub] [incubator-mxnet] ptrendx commented on a change in pull request #14898: prevent TRT_Logger to be destroyed before TRT engine

ptrendx commented on a change in pull request #14898: prevent TRT_Logger to be destroyed before TRT engine
URL: https://github.com/apache/incubator-mxnet/pull/14898#discussion_r285754191
 
 

 ##########
 File path: src/operator/subgraph/tensorrt/onnx_to_tensorrt.cc
 ##########
 @@ -83,18 +83,18 @@ void PrintVersion() {
     << NV_TENSORRT_PATCH << endl;
 }
 
-std::tuple<nvinfer1::ICudaEngine*, nvonnxparser::IParser*> onnxToTrtCtx(
+std::tuple<nvinfer1::ICudaEngine*, nvonnxparser::IParser*, TRT_Logger*> onnxToTrtCtx(
         const std::string& onnx_model,
         int32_t max_batch_size,
         size_t max_workspace_size,
         nvinfer1::ILogger::Severity verbosity,
         bool debug_builder) {
   GOOGLE_PROTOBUF_VERIFY_VERSION;
 
-  TRT_Logger trt_logger(verbosity);
-  auto trt_builder = InferObject(nvinfer1::createInferBuilder(trt_logger));
+  TRT_Logger* trt_logger = new TRT_Logger(verbosity);
 
 Review comment:
   unique_ptr?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services