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

Function getMissingLayerWeightsRolePair

samples/common/sampleEngines.cpp:1304–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1302}
1303
1304std::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
1324bool loadEngineToBuildEnv(std::string const& engine, bool enableConsistency, BuildEnvironment& env, std::ostream& err)

Callers 1

timeRefitFunction · 0.85

Calls 2

getMissingMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected