MCPcopy Create free account
hub / github.com/Tencent/TNN / VectorToString

Function VectorToString

source/tnn/utils/string_format.h:49–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48template <typename T>
49std::string VectorToString(std::vector<T> val) {
50 if (val.empty())
51 return "";
52
53 std::stringstream stream;
54 stream << "[";
55 for (int i = 0; i < val.size(); ++i) {
56 stream << val[i];
57 if (i != val.size() - 1)
58 stream << ",";
59 }
60 stream << "]";
61 return stream.str();
62}
63
64std::vector<std::pair<std::string, std::vector<float>>> SortMapByValue(std::map<std::string, std::vector<float>> &map);
65

Callers 2

GetProfilingDataInfoMethod · 0.85
GetProfilingDataInfoMethod · 0.85

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected