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

Function initializeSampleParams

samples/sampleOnnxMNIST/sampleOnnxMNIST.cpp:334–354  ·  view source on GitHub ↗

\brief Initializes members of the params struct using the command line args

Source from the content-addressed store, hash-verified

332//! \brief Initializes members of the params struct using the command line args
333//!
334samplesCommon::OnnxSampleParams initializeSampleParams(const samplesCommon::Args& args)
335{
336 samplesCommon::OnnxSampleParams params;
337 if (args.dataDirs.empty()) // Use default directories if user hasn't provided directory paths
338 {
339 params.dataDirs.push_back("data/mnist/");
340 params.dataDirs.push_back("data/samples/mnist/");
341 }
342 else // Use the data directory provided by the user
343 {
344 params.dataDirs = args.dataDirs;
345 }
346 params.onnxFileName = "mnist.onnx";
347 params.inputTensorNames.push_back("Input3");
348 params.outputTensorNames.push_back("Plus214_Output_0");
349 params.dlaCore = args.useDLACore;
350 params.int8 = args.runInInt8;
351 params.fp16 = args.runInFp16;
352
353 return params;
354}
355
356//!
357//! \brief Prints the help information for running this sample

Callers 1

mainFunction · 0.70

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected