| 225 | }; |
| 226 | |
| 227 | inline std::string tensor_to_str ( |
| 228 | const tensor& t, |
| 229 | int& min_length |
| 230 | ) |
| 231 | { |
| 232 | if (t.size() == 0) |
| 233 | return ""; |
| 234 | |
| 235 | std::ostringstream sout; |
| 236 | sout << "output size=(num:"<< t.num_samples() << ", "; |
| 237 | sout << "k:" << t.k() << ","; |
| 238 | while (sout.tellp() < 28) sout << " "; |
| 239 | sout << "nr:" << t.nr() << ","; |
| 240 | while (sout.tellp() < 28+8) sout << " "; |
| 241 | sout << "nc:" << t.nc() << ")"; |
| 242 | while (sout.tellp() < min_length) sout << " "; |
| 243 | min_length = sout.tellp(); |
| 244 | sout << "\t"; |
| 245 | return sout.str(); |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // ---------------------------------------------------------------------------------------- |