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

Function ParseArrayImpl

tests/DeepSpeechV1Database.hpp:25–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template<typename T, typename TParseElementFunc>
25std::vector<T> ParseArrayImpl(std::istream& stream, TParseElementFunc parseElementFunc, const char * chars = "\t ,:")
26{
27 std::vector<T> result;
28 // Processes line-by-line.
29 std::string line;
30 while (std::getline(stream, line))
31 {
32 std::vector<std::string> tokens = armnn::stringUtils::StringTokenizer(line, chars);
33 for (const std::string& token : tokens)
34 {
35 if (!token.empty()) // See https://stackoverflow.com/questions/10437406/
36 {
37 try
38 {
39 result.push_back(parseElementFunc(token));
40 }
41 catch (const std::exception&)
42 {
43 ARMNN_LOG(error) << "'" << token << "' is not a valid number. It has been ignored.";
44 }
45 }
46 }
47 }
48
49 return result;
50}
51
52template<armnn::DataType NonQuantizedType>
53auto ParseDataArray(std::istream & stream);

Callers

nothing calls this directly

Calls 3

StringTokenizerFunction · 0.85
emptyMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected