MCPcopy Create free account
hub / github.com/ARM-software/armnn / ParseArrayImpl

Function ParseArrayImpl

tests/NetworkExecutionUtils/NetworkExecutionUtils.hpp:280–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278
279template<typename T, typename TParseElementFunc>
280std::vector<T> ParseArrayImpl(std::istream& stream, TParseElementFunc parseElementFunc, const char* chars = "\t ,:")
281{
282 std::vector<T> result;
283 // Processes line-by-line.
284 std::string line;
285 while (std::getline(stream, line))
286 {
287 std::vector<std::string> tokens = armnn::stringUtils::StringTokenizer(line, chars);
288 for (const std::string& token : tokens)
289 {
290 if (!token.empty()) // See https://stackoverflow.com/questions/10437406/
291 {
292 try
293 {
294 result.push_back(parseElementFunc(token));
295 }
296 catch (const std::exception&)
297 {
298 ARMNN_LOG(error) << "'" << token << "' is not a valid number. It has been ignored.";
299 }
300 }
301 }
302 }
303
304 return result;
305}

Callers

nothing calls this directly

Calls 3

StringTokenizerFunction · 0.85
emptyMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected