Skip to content

Handle asarray/asanyarray cases where like is a dask.Array#8128

Merged
jsignell merged 2 commits intodask:mainfrom
pentschev:asarray-like-dask-array
Sep 9, 2021
Merged

Handle asarray/asanyarray cases where like is a dask.Array#8128
jsignell merged 2 commits intodask:mainfrom
pentschev:asarray-like-dask-array

Conversation

@pentschev
Copy link
Copy Markdown
Member

Follow-up case to #8054 where the input is a Dask array and like= is another Dask array but with a different chunk type.

Before:

>>> import numpy as np, cupy as cp, dask.array as da
>>> np.asarray(da.array([1, 2, 3]), like=da.from_array(cp.array(())))
dask.array<array, shape=(3,), dtype=int64, chunksize=(3,), chunktype=numpy.ndarray>

After:

>>> import numpy as np, cupy as cp, dask.array as da
>>> np.asarray(da.array([1, 2, 3]), like=da.from_array(cp.array(())))
dask.array<asarray, shape=(3,), dtype=int64, chunksize=(3,), chunktype=cupy.ndarray>

@github-actions github-actions bot added the array label Sep 8, 2021
@pentschev
Copy link
Copy Markdown
Member Author

Tests failing here seem to be the same as in #8127 .

@jakirkham
Copy link
Copy Markdown
Member

cc @jsignell (in case this is of interest 🙂)

Copy link
Copy Markdown
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me!

@jsignell jsignell merged commit e1974bf into dask:main Sep 9, 2021
@pentschev
Copy link
Copy Markdown
Member Author

Thanks @jsignell and @jakirkham !

@pentschev pentschev deleted the asarray-like-dask-array branch September 14, 2021 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants