\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
| 187 | //! \param builder Pointer to the engine builder |
| 188 | //! |
| 189 | bool SampleOnnxMNIST::constructNetwork(SampleUniquePtr<nvinfer1::IBuilder>& builder, |
| 190 | SampleUniquePtr<nvinfer1::INetworkDefinition>& network, SampleUniquePtr<nvinfer1::IBuilderConfig>& config, |
| 191 | SampleUniquePtr<nvonnxparser::IParser>& parser) |
| 192 | { |
| 193 | auto parsed = parser->parseFromFile(locateFile(mParams.onnxFileName, mParams.dataDirs).c_str(), |
| 194 | static_cast<int>(sample::gLogger.getReportableSeverity())); |
| 195 | if (!parsed) |
| 196 | { |
| 197 | return false; |
| 198 | } |
| 199 | |
| 200 | if (mParams.fp16) |
| 201 | { |
| 202 | config->setFlag(BuilderFlag::kFP16); |
| 203 | } |
| 204 | if (mParams.int8) |
| 205 | { |
| 206 | config->setFlag(BuilderFlag::kINT8); |
| 207 | samplesCommon::setAllDynamicRanges(network.get(), 127.0F, 127.0F); |
| 208 | } |
| 209 | |
| 210 | samplesCommon::enableDLA(builder.get(), config.get(), mParams.dlaCore); |
| 211 | |
| 212 | return true; |
| 213 | } |
| 214 | |
| 215 | //! |
| 216 | //! \brief Runs the TensorRT inference engine for this sample |
nothing calls this directly
no test coverage detected