MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / arr2str

Function arr2str

src/fastertransformer/utils/string_utils.h:71–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70template<typename T>
71inline std::string arr2str(T* arr, size_t size)
72{
73 std::stringstream ss;
74 ss << "(";
75 for (size_t i = 0; i < size - 1; ++i) {
76 ss << arr[i] << ", ";
77 }
78 if (size > 0) {
79 ss << arr[size - 1];
80 }
81 ss << ")";
82 return ss.str();
83}
84} // namespace fastertransformer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected