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

Method getTensorInfo

samples/common/sampleInference.cpp:166–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164
165template <>
166void FillBindingClosure<nvinfer1::ICudaEngine, nvinfer1::IExecutionContext>::getTensorInfo(TensorInfo& tensorInfo)
167{
168 auto const b = tensorInfo.bindingIndex;
169 auto const name = engine->getBindingName(b);
170 tensorInfo.name = name;
171 if (engine->hasImplicitBatchDimension())
172 {
173 tensorInfo.dims = context->getBindingDimensions(b);
174 tensorInfo.comps = engine->getBindingComponentsPerElement(b);
175 tensorInfo.strides = context->getStrides(b);
176 tensorInfo.vectorDimIndex = engine->getBindingVectorizedDim(b);
177 tensorInfo.isInput = engine->bindingIsInput(b);
178 tensorInfo.dataType = engine->getBindingDataType(b);
179 }
180 else
181 {
182 // Use enqueueV3.
183 tensorInfo.dims = context->getTensorShape(name);
184 tensorInfo.isDynamic = std::any_of(
185 tensorInfo.dims.d, tensorInfo.dims.d + tensorInfo.dims.nbDims, [](int32_t dim) { return dim == -1; });
186 tensorInfo.comps = engine->getTensorComponentsPerElement(name);
187 tensorInfo.strides = context->getTensorStrides(name);
188 tensorInfo.vectorDimIndex = engine->getTensorVectorizedDim(name);
189 tensorInfo.isInput = engine->getTensorIOMode(name) == TensorIOMode::kINPUT;
190 tensorInfo.dataType = engine->getTensorDataType(name);
191 }
192}
193
194template <>
195void FillBindingClosure<nvinfer1::safe::ICudaEngine, nvinfer1::safe::IExecutionContext>::getTensorInfo(

Callers

nothing calls this directly

Calls 14

getBindingNameMethod · 0.80
bindingIsInputMethod · 0.80
getBindingDataTypeMethod · 0.80
getTensorStridesMethod · 0.80
getTensorIOModeMethod · 0.80
getTensorDataTypeMethod · 0.80
getBindingDimensionsMethod · 0.45

Tested by

no test coverage detected