MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / write_tuple

Function write_tuple

include/libnpy/npy.hpp:319–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317
318template<typename T>
319inline std::string write_tuple(const std::vector <T> &v) {
320 if (v.size() == 0)
321 return "()";
322
323 std::ostringstream ss;
324
325 if (v.size() == 1) {
326 ss << "(" << v.front() << ",)";
327 } else {
328 const std::string delimiter = ", ";
329 // v.size() > 1
330 ss << "(";
331 std::copy(v.begin(), v.end() - 1, std::ostream_iterator<T>(ss, delimiter.c_str()));
332 ss << v.back();
333 ss << ")";
334 }
335
336 return ss.str();
337}
338
339inline std::string write_boolean(bool b) {
340 if (b)

Callers 1

write_header_dictFunction · 0.85

Calls 5

strMethod · 0.80
copyFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected