Handle out parameters If out is a dask.array then this overwrites the contents of that array with the result
(out, result)
| 5040 | |
| 5041 | |
| 5042 | def 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 | |
| 5064 | def _enforce_dtype(*args, **kwargs): |
no test coverage detected