| 129 | }; |
| 130 | |
| 131 | std::string ArrayShapeToString(ArrayShape shape) { |
| 132 | std::ostringstream out; |
| 133 | out << ToString(shape.type) << "["; |
| 134 | for (int i = 0; i < shape.dimensions.size(); i++) { |
| 135 | out << std::to_string(shape.dimensions[i]); |
| 136 | if (i != shape.dimensions.size() - 1) { |
| 137 | out << ","; |
| 138 | } |
| 139 | } |
| 140 | out << "]"; |
| 141 | return out.str(); |
| 142 | } |
| 143 | |
| 144 | // Input: TYPE[D1,D2,...DN] |
| 145 | ArrayShape ArrayShapeFromString(const std::string& s) { |
no test coverage detected