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

Class TakeUnknownOneChunk

dask/array/_array_expr/_slicing.py:469–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467
468
469class TakeUnknownOneChunk(Slice):
470 _parameters = ["array", "index", "axis"]
471
472 @functools.cached_property
473 def chunks(self):
474 return self.array.chunks
475
476 def _layer(self) -> dict:
477 slices = [slice(None)] * len(self.array.chunks)
478 slices[self.axis] = list(self.index)
479 sl = tuple(slices)
480 chunk_tuples = list(
481 product(*(range(len(c)) for i, c in enumerate(self.array.chunks)))
482 )
483 dsk = {
484 (self._name,)
485 + ct: Task(
486 (self._name,) + ct, getitem, TaskRef((self.array.name,) + ct), sl
487 )
488 for ct in chunk_tuples
489 }
490 return dsk

Callers 1

takeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…