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

Method getInputOutputNames

samples/sampleINT8API/sampleINT8API.cpp:162–188  ·  view source on GitHub ↗

\brief Populates input and output mapping of the network

Source from the content-addressed store, hash-verified

160//! \brief Populates input and output mapping of the network
161//!
162void SampleINT8API::getInputOutputNames()
163{
164 int nbindings = mEngine.get()->getNbBindings();
165 ASSERT(nbindings == 2);
166 for (int b = 0; b < nbindings; ++b)
167 {
168 nvinfer1::Dims dims = mEngine.get()->getBindingDimensions(b);
169 if (mEngine.get()->bindingIsInput(b))
170 {
171 if (mParams.verbose)
172 {
173 sample::gLogInfo << "Found input: " << mEngine.get()->getBindingName(b) << " shape=" << dims
174 << " dtype=" << (int) mEngine.get()->getBindingDataType(b) << std::endl;
175 }
176 mInOut["input"] = mEngine.get()->getBindingName(b);
177 }
178 else
179 {
180 if (mParams.verbose)
181 {
182 sample::gLogInfo << "Found output: " << mEngine.get()->getBindingName(b) << " shape=" << dims
183 << " dtype=" << (int) mEngine.get()->getBindingDataType(b) << std::endl;
184 }
185 mInOut["output"] = mEngine.get()->getBindingName(b);
186 }
187 }
188}
189
190//!
191//! \brief Populate per-tensor dyanamic range values

Callers

nothing calls this directly

Calls 6

getNbBindingsMethod · 0.80
bindingIsInputMethod · 0.80
getBindingNameMethod · 0.80
getBindingDataTypeMethod · 0.80
getMethod · 0.45
getBindingDimensionsMethod · 0.45

Tested by

no test coverage detected