| 164 | |
| 165 | template <> |
| 166 | void 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 | |
| 194 | template <> |
| 195 | void FillBindingClosure<nvinfer1::safe::ICudaEngine, nvinfer1::safe::IExecutionContext>::getTensorInfo( |
nothing calls this directly
no test coverage detected