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

Function handle_out

dask/array/core.py:5243–5262  ·  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

5241
5242
5243def handle_out(out, result):
5244 """Handle out parameters
5245
5246 If out is a dask.array then this overwrites the contents of that array with
5247 the result
5248 """
5249 out = _elemwise_normalize_out(out)
5250 if isinstance(out, Array):
5251 if out.shape != result.shape:
5252 raise ValueError(
5253 "Mismatched shapes between result and out parameter. "
5254 f"out={out.shape}, result={result.shape}"
5255 )
5256 out._chunks = result.chunks
5257 out.dask = result.dask
5258 out._meta = result._meta
5259 out._name = result.name
5260 return out
5261 else:
5262 return result
5263
5264
5265def _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