MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CommaSeparatedString

Function CommaSeparatedString

tensorflow/compiler/xla/util.h:372–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370// appended to the returned string.
371template <typename Container>
372string CommaSeparatedString(const Container& c, const char* prefix = "",
373 const char* suffix = "") {
374 // Not using Join() since the implementation here is simple anyway and this
375 // avoids copying the string to append prefix.
376 string comma_separated = prefix;
377 const char* separator = "";
378 for (const auto& entry : c) {
379 absl::StrAppend(&comma_separated, separator, entry);
380 separator = ", ";
381 }
382 comma_separated += suffix;
383 return comma_separated;
384}
385
386// Overload needed to allow the container to be an initializer list. The default
387// type for T makes an empty initializer list work as well.

Callers 2

TESTFunction · 0.85
VectorStringFunction · 0.85

Calls 1

StrAppendFunction · 0.50

Tested by 1

TESTFunction · 0.68