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

Function getLayerWeightsRolePair

samples/common/sampleEngines.cpp:1285–1302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1283namespace
1284{
1285std::pair<std::vector<std::string>, std::vector<WeightsRole>> getLayerWeightsRolePair(IRefitter& refitter)
1286{
1287 // Get number of refittable items.
1288 auto const nbAll = refitter.getAll(0, nullptr, nullptr);
1289 std::vector<char const*> layerNames(nbAll);
1290 // Allocate buffers for the items and get them.
1291 std::vector<nvinfer1::WeightsRole> weightsRoles(nbAll);
1292 refitter.getAll(nbAll, layerNames.data(), weightsRoles.data());
1293 std::vector<std::string> layerNameStrs(nbAll);
1294 std::transform(layerNames.begin(), layerNames.end(), layerNameStrs.begin(), [](char const* name) {
1295 if (name == nullptr)
1296 {
1297 return std::string{};
1298 }
1299 return std::string{name};
1300 });
1301 return {layerNameStrs, weightsRoles};
1302}
1303
1304std::pair<std::vector<std::string>, std::vector<WeightsRole>> getMissingLayerWeightsRolePair(IRefitter& refitter)
1305{

Callers 2

dumpRefittableFunction · 0.85
timeRefitFunction · 0.85

Calls 2

getAllMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected