MCPcopy
hub / github.com/dask/dask / _compute_multiplier

Function _compute_multiplier

dask/array/core.py:3244–3254  ·  view source on GitHub ↗

Utility function for auto_chunk, to fin how much larger or smaller the ideal chunk size is relative to what we have now.

(limit: int, dtype, largest_block: int, result)

Source from the content-addressed store, hash-verified

3242
3243
3244def _compute_multiplier(limit: int, dtype, largest_block: int, result):
3245 """
3246 Utility function for auto_chunk, to fin how much larger or smaller the ideal
3247 chunk size is relative to what we have now.
3248 """
3249 return (
3250 limit
3251 / dtype.itemsize
3252 / largest_block
3253 / math.prod(max(r) if isinstance(r, tuple) else r for r in result.values() if r)
3254 )
3255
3256
3257def auto_chunks(chunks, shape, limit, dtype, previous_chunks=None):

Callers 1

auto_chunksFunction · 0.85

Calls 3

maxFunction · 0.90
prodMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…