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

Function getLayerOutputTypes

samples/common/sampleOptions.cpp:332–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332void getLayerOutputTypes(Arguments& arguments, char const* argument, LayerOutputTypes& layerOutputTypes)
333{
334 std::string list;
335 if (!getAndDelOption(arguments, argument, list))
336 {
337 return;
338 }
339
340 // The layerOutputTypes flag contains comma-separated layerName:types pairs.
341 std::vector<std::string> precisionList{splitToStringVec(list, ',')};
342 for (auto const& s : precisionList)
343 {
344 auto namePrecisionPair = splitNameAndValue<std::string>(s);
345 auto const layerName = removeSingleQuotationMarks(namePrecisionPair.first);
346 auto const typeStrings = splitToStringVec(namePrecisionPair.second, '+');
347 std::vector<nvinfer1::DataType> typeVec(typeStrings.size(), nvinfer1::DataType::kFLOAT);
348 std::transform(typeStrings.begin(), typeStrings.end(), typeVec.begin(), stringToValue<nvinfer1::DataType>);
349 layerOutputTypes[layerName] = typeVec;
350 }
351}
352
353void getLayerDeviceTypes(Arguments& arguments, char const* argument, LayerDeviceTypes& layerDeviceTypes)
354{

Callers 1

parseMethod · 0.85

Calls 4

getAndDelOptionFunction · 0.85
splitToStringVecFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected