| 1302 | } |
| 1303 | |
| 1304 | std::pair<std::vector<std::string>, std::vector<WeightsRole>> getMissingLayerWeightsRolePair(IRefitter& refitter) |
| 1305 | { |
| 1306 | // Get number of refittable items. |
| 1307 | auto const nbMissing = refitter.getMissing(0, nullptr, nullptr); |
| 1308 | std::vector<char const*> layerNames(nbMissing); |
| 1309 | // Allocate buffers for the items and get them. |
| 1310 | std::vector<nvinfer1::WeightsRole> weightsRoles(nbMissing); |
| 1311 | refitter.getMissing(nbMissing, layerNames.data(), weightsRoles.data()); |
| 1312 | std::vector<std::string> layerNameStrs(nbMissing); |
| 1313 | std::transform(layerNames.begin(), layerNames.end(), layerNameStrs.begin(), [](char const* name) { |
| 1314 | if (name == nullptr) |
| 1315 | { |
| 1316 | return std::string{}; |
| 1317 | } |
| 1318 | return std::string{name}; |
| 1319 | }); |
| 1320 | return {layerNameStrs, weightsRoles}; |
| 1321 | } |
| 1322 | } // namespace |
| 1323 | |
| 1324 | bool loadEngineToBuildEnv(std::string const& engine, bool enableConsistency, BuildEnvironment& env, std::ostream& err) |
no test coverage detected