MCPcopy Create free account
hub / github.com/dask/dask / handle_out

Function handle_out

dask/array/core.py:5042–5061  ·  view source on GitHub ↗

Handle out parameters If out is a dask.array then this overwrites the contents of that array with the result

(out, result)

Source from the content-addressed store, hash-verified

5040
5041
5042def handle_out(out, result):
5043 """Handle out parameters
5044
5045 If out is a dask.array then this overwrites the contents of that array with
5046 the result
5047 """
5048 out = _elemwise_normalize_out(out)
5049 if isinstance(out, Array):
5050 if out.shape != result.shape:
5051 raise ValueError(
5052 "Mismatched shapes between result and out parameter. "
5053 "out=%s, result=%s" % (str(out.shape), str(result.shape))
5054 )
5055 out._chunks = result.chunks
5056 out.dask = result.dask
5057 out._meta = result._meta
5058 out._name = result.name
5059 return out
5060 else:
5061 return result
5062
5063
5064def _enforce_dtype(*args, **kwargs):

Callers 9

reductionFunction · 0.90
arg_reductionFunction · 0.90
prefixscan_blellochFunction · 0.90
cumreductionFunction · 0.90
medianFunction · 0.90
nanmedianFunction · 0.90
quantileFunction · 0.90
nanquantileFunction · 0.90
elemwiseFunction · 0.70

Calls 1

_elemwise_normalize_outFunction · 0.85

Tested by

no test coverage detected