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

Method constructNetwork

samples/sampleIOFormats/sampleIOFormats.cpp:404–418  ·  view source on GitHub ↗

\brief Uses a ONNX parser to create the Onnx MNIST Network and marks the output layers \param network Pointer to the network that will be populated with the Onnx MNIST network \param builder Pointer to the engine builder

Source from the content-addressed store, hash-verified

402//! \param builder Pointer to the engine builder
403//!
404bool SampleIOFormats::constructNetwork(SampleUniquePtr<nvinfer1::IBuilder>& builder,
405 SampleUniquePtr<nvinfer1::INetworkDefinition>& network, SampleUniquePtr<nvinfer1::IBuilderConfig>& config,
406 SampleUniquePtr<nvonnxparser::IParser>& parser)
407{
408 auto parsed = parser->parseFromFile(locateFile(mParams.onnxFileName, mParams.dataDirs).c_str(),
409 static_cast<int32_t>(sample::gLogger.getReportableSeverity()));
410 if (!parsed)
411 {
412 return false;
413 }
414
415 samplesCommon::enableDLA(builder.get(), config.get(), mParams.dlaCore);
416
417 return true;
418}
419
420//!
421//! \brief Runs the TensorRT inference engine for this sample

Callers

nothing calls this directly

Calls 5

locateFileFunction · 0.85
enableDLAFunction · 0.85
c_strMethod · 0.80
getReportableSeverityMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected