| 1283 | namespace |
| 1284 | { |
| 1285 | std::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 | |
| 1304 | std::pair<std::vector<std::string>, std::vector<WeightsRole>> getMissingLayerWeightsRolePair(IRefitter& refitter) |
| 1305 | { |
no test coverage detected