| 558 | } |
| 559 | |
| 560 | std::string minimalDim4(af::dim4 coords, af::dim4 dims) { |
| 561 | std::ostringstream os; |
| 562 | os << "(" << coords[0]; |
| 563 | if (dims[1] > 1 || dims[2] > 1 || dims[3] > 1) { os << ", " << coords[1]; } |
| 564 | if (dims[2] > 1 || dims[3] > 1) { os << ", " << coords[2]; } |
| 565 | if (dims[3] > 1) { os << ", " << coords[3]; } |
| 566 | os << ")"; |
| 567 | |
| 568 | return os.str(); |
| 569 | } |
| 570 | |
| 571 | // Generates a random array. testWriteToOutputArray expects that it will |
| 572 | // receive the same af_array that this generates after the af_* function is |