MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / constructNetwork

Method constructNetwork

samples/sampleNamedDimensions/sampleNamedDimensions.cpp:209–221  ·  view source on GitHub ↗

\brief Uses ONNX parser to create the ONNX Network and marks the output layers

Source from the content-addressed store, hash-verified

207//! \brief Uses ONNX parser to create the ONNX Network and marks the output layers
208//!
209bool SampleNamedDimensions::constructNetwork(SampleUniquePtr<nvinfer1::IBuilder>& builder,
210 SampleUniquePtr<nvinfer1::INetworkDefinition>& network, SampleUniquePtr<nvinfer1::IBuilderConfig>& config,
211 SampleUniquePtr<nvonnxparser::IParser>& parser)
212{
213 auto parsed = parser->parseFromFile(locateFile(mParams.onnxFileName, mParams.dataDirs).c_str(),
214 static_cast<int32_t>(sample::gLogger.getReportableSeverity()));
215 if (!parsed)
216 {
217 return false;
218 }
219
220 return true;
221}
222
223//!
224//! \brief Adds an optimization profile for dynamic shapes

Callers

nothing calls this directly

Calls 3

locateFileFunction · 0.85
c_strMethod · 0.80
getReportableSeverityMethod · 0.45

Tested by

no test coverage detected