MCPcopy
hub / github.com/dask/dask / handle_out

Function handle_out

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…