The SampleAlgorithmSelector class implements the SampleAlgorithmSelector sample.
More...
The SampleAlgorithmSelector class implements the SampleAlgorithmSelector sample.
It creates the network using a trained Caffe MNIST classification model.
◆ SampleUniquePtr
◆ SampleAlgorithmSelector()
◆ build()
Builds the network engine.
Creates the network, configures the builder and creates the network engine.
This function creates the MNIST network by parsing the caffe model and builds the engine that will be used to run MNIST (mEngine).
- Returns
- Returns true if the engine was created successfully and false otherwise.
◆ infer()
bool SampleAlgorithmSelector::infer |
( |
| ) |
|
Runs the TensorRT inference engine for this sample.
This function is the main execution function of the sample. It allocates the buffer, sets inputs, executes the engine, and verifies the output.
◆ teardown()
bool SampleAlgorithmSelector::teardown |
( |
| ) |
|
Used to clean up any state created in the sample class.
Clean up the libprotobuf files as the parsing is complete.
- Note
- It is not safe to use any other part of the protocol buffers library after ShutdownProtobufLibrary() has been called.
◆ constructNetwork()
uses a Caffe parser to create the MNIST Network and marks the output layers.
Uses a caffe parser to create the MNIST Network and marks the output layers.
- Parameters
-
network | Pointer to the network that will be populated with the MNIST network. |
builder | Pointer to the engine builder. |
◆ processInput()
Reads the input and mean data, preprocesses, and stores the result in a managed buffer.
◆ verifyOutput()
bool SampleAlgorithmSelector::verifyOutput |
( |
const samplesCommon::BufferManager & |
buffers, |
|
|
const std::string & |
outputTensorName, |
|
|
int |
groundTruthDigit |
|
) |
| const |
|
private |
Verifies that the output is correct and prints it.
◆ mEngine
The TensorRT engine used to run the network.
◆ mParams
The parameters for the sample.
◆ mInputDims
The dimensions of the input to the network.
◆ mMeanBlob
The documentation for this class was generated from the following file:
- sampleAlgorithmSelector.cpp