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

Function getAndDelRepeatedOption

samples/common/sampleOptions.cpp:273–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271//! If it does not: return false.
272template <typename T>
273bool getAndDelRepeatedOption(Arguments& arguments, const std::string& option, std::vector<T>& values)
274{
275 const auto match = arguments.equal_range(option);
276 if (match.first == match.second)
277 {
278 return false;
279 }
280
281 auto addToValues
282 = [&values](Arguments::value_type& argValue) { values.emplace_back(stringToValue<T>(argValue.second)); };
283 std::for_each(match.first, match.second, addToValues);
284 arguments.erase(match.first, match.second);
285
286 return true;
287}
288
289void insertShapesBuild(BuildOptions::ShapeProfile& shapes, nvinfer1::OptProfileSelector selector,
290 const std::string& name, const std::vector<int32_t>& dims)

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected