(x)
| 295 | |
| 296 | @derived_from(np) |
| 297 | def frexp(x): |
| 298 | # Not actually object dtype, just need to specify something |
| 299 | tmp = elemwise(np.frexp, x, dtype=object) |
| 300 | left = "mantissa-" + tmp.name |
| 301 | right = "exponent-" + tmp.name |
| 302 | ldsk = { |
| 303 | (left,) + key[1:]: (getitem, key, 0) |
| 304 | for key in core.flatten(tmp.__dask_keys__()) |
| 305 | } |
| 306 | rdsk = { |
| 307 | (right,) + key[1:]: (getitem, key, 1) |
| 308 | for key in core.flatten(tmp.__dask_keys__()) |
| 309 | } |
| 310 | |
| 311 | a = np.empty_like(getattr(x, "_meta", x), shape=(1,) * x.ndim, dtype=x.dtype) |
| 312 | l, r = np.frexp(a) |
| 313 | |
| 314 | graph = HighLevelGraph.from_collections(left, ldsk, dependencies=[tmp]) |
| 315 | L = Array(graph, left, chunks=tmp.chunks, meta=l) |
| 316 | graph = HighLevelGraph.from_collections(right, rdsk, dependencies=[tmp]) |
| 317 | R = Array(graph, right, chunks=tmp.chunks, meta=r) |
| 318 | return L, R |
| 319 | |
| 320 | |
| 321 | @derived_from(np) |
nothing calls this directly
no test coverage detected