| 409 | } |
| 410 | |
| 411 | static void preview_argument(std::ostream& os, const argument& a) |
| 412 | { |
| 413 | a.visit( |
| 414 | [&](auto t) { |
| 415 | if(t.size() <= 10) |
| 416 | { |
| 417 | os << t; |
| 418 | } |
| 419 | else |
| 420 | { |
| 421 | os << to_string_range(t.begin(), t.begin() + 5); |
| 422 | os << ", ..., "; |
| 423 | os << to_string_range(t.end() - 5, t.end()); |
| 424 | } |
| 425 | }, |
| 426 | [&](const auto& xs) { |
| 427 | for(const auto& x : xs) |
| 428 | { |
| 429 | os << '{'; |
| 430 | preview_argument(os, x); |
| 431 | os << '}'; |
| 432 | } |
| 433 | }); |
| 434 | } |
| 435 | |
| 436 | // This function currently used only in an Assertion. |
| 437 | // "Almost identical" shapes. To support an MLIR feature, there is a limited |