MCPcopy Create free account
hub / github.com/LBANN/lbann / show_shape

Function show_shape

src/utils/cnpy_utils.cpp:72–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72std::string show_shape(const cnpy::NpyArray& na)
73{
74 std::string ret;
75 for (const size_t s : na.shape) {
76 ret += std::to_string(s) + 'x';
77 }
78 if (ret.size() == 0u) {
79 return "empty";
80 }
81 else {
82 ret.pop_back(); // remove the last 'x'
83 ret += " " + std::to_string(na.word_size);
84 }
85 return ret;
86}
87
88} // end of namespace cnpy_utils
89} // end of namespace lbann

Callers

nothing calls this directly

Calls 2

to_stringFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected