| 70 | } |
| 71 | |
| 72 | std::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 |