MCPcopy
hub / github.com/dask/dask / mean_combine

Function mean_combine

dask/array/reductions.py:346–367  ·  view source on GitHub ↗
(
    pairs,
    sum=chunk.sum,
    numel=numel,
    dtype="f8",
    axis=None,
    computing_meta=False,
    **kwargs,
)

Source from the content-addressed store, hash-verified

344
345
346def mean_combine(
347 pairs,
348 sum=chunk.sum,
349 numel=numel,
350 dtype="f8",
351 axis=None,
352 computing_meta=False,
353 **kwargs,
354):
355 if not isinstance(pairs, list):
356 pairs = [pairs]
357
358 ns = deepmap(lambda pair: pair["n"], pairs) if not computing_meta else pairs
359 n = _concatenate2(ns, axes=axis).sum(axis=axis, **kwargs)
360
361 if computing_meta:
362 return n
363
364 totals = deepmap(lambda pair: pair["total"], pairs)
365 total = _concatenate2(totals, axes=axis).sum(axis=axis, **kwargs)
366
367 return {"n": n, "total": total}
368
369
370def mean_agg(pairs, dtype="f8", axis=None, computing_meta=False, **kwargs):

Callers

nothing calls this directly

Calls 3

deepmapFunction · 0.90
_concatenate2Function · 0.90
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…