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

Function vec2str

src/fastertransformer/utils/string_utils.h:56–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54
55template<typename T>
56inline std::string vec2str(std::vector<T> vec)
57{
58 std::stringstream ss;
59 ss << "(";
60 if (!vec.empty()) {
61 for (size_t i = 0; i < vec.size() - 1; ++i) {
62 ss << vec[i] << ", ";
63 }
64 ss << vec.back();
65 }
66 ss << ")";
67 return ss.str();
68}
69
70template<typename T>
71inline std::string arr2str(T* arr, size_t size)

Callers 11

TensorMapClass · 0.85
atMethod · 0.85
getValMethod · 0.85
getValWithOffsetMethod · 0.85
getPtrMethod · 0.85
getPtrWithOffsetMethod · 0.85
toStringMethod · 0.85
setupMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected