MCPcopy Index your code
hub / github.com/dask/dask / _shuffle

Function _shuffle

dask/array/_array_expr/_shuffle.py:32–44  ·  view source on GitHub ↗
(x, indexer, axis, name)

Source from the content-addressed store, hash-verified

30
31
32def _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
47class Shuffle(ArrayExpr):

Callers 1

takeFunction · 0.90

Calls 2

_validate_indexerFunction · 0.70
ShuffleClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…