(x, indexer, axis, name)
| 30 | |
| 31 | |
| 32 | def _shuffle(x, indexer, axis, name): |
| 33 | _validate_indexer(x.chunks, indexer, axis) |
| 34 | |
| 35 | if len(indexer) == len(x.chunks[axis]): |
| 36 | # check if the array is already shuffled the way we want |
| 37 | ctr = 0 |
| 38 | for idx, c in zip(indexer, x.chunks[axis]): |
| 39 | if idx != list(range(ctr, ctr + c)): |
| 40 | break |
| 41 | ctr += c |
| 42 | else: |
| 43 | return x |
| 44 | return Shuffle(x, indexer, axis, name) |
| 45 | |
| 46 | |
| 47 | class Shuffle(ArrayExpr): |
no test coverage detected
searching dependent graphs…