Skip to content

Commit

Permalink
Fix TRT depreciation warnings (#523)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jomier <[email protected]>
  • Loading branch information
jjomier authored Oct 2, 2024
1 parent 68af0b4 commit f2042bf
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,13 @@ gxf::Expected<std::vector<char>> TensorRtInference::convertModelToEngine() {
if (enable_fp16_.get()) { builderConfig->setFlag(nvinfer1::BuilderFlag::kFP16); }

// Parses ONNX with explicit batch size for support of dynamic shapes/batch
NvInferHandle<nvinfer1::INetworkDefinition> network(builder->createNetworkV2(
1U << static_cast<uint32_t>(nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH)));
#if NV_TENSORRT_MAJOR < 10
const auto explicitBatch =
1U << static_cast<uint32_t>(nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH);
#else
const auto explicitBatch = 1U;
#endif
NvInferHandle<nvinfer1::INetworkDefinition> network(builder->createNetworkV2(explicitBatch));

NvInferHandle<nvonnxparser::IParser> onnx_parser(
nvonnxparser::createParser(*network, cuda_logger_));
Expand Down

0 comments on commit f2042bf

Please sign in to comment.