| 271 | //! If it does not: return false. |
| 272 | template <typename T> |
| 273 | bool 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 | |
| 289 | void insertShapesBuild(BuildOptions::ShapeProfile& shapes, nvinfer1::OptProfileSelector selector, |
| 290 | const std::string& name, const std::vector<int32_t>& dims) |