Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEP-18: fix() with CuPy array depends on __array_wrap__ #4496

Closed
pentschev opened this issue Feb 18, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@pentschev
Copy link
Member

commented Feb 18, 2019

Calling dask.array.fix() on a Dask array created from a CuPy array fails as it depends on unimplemented __array_wrap__ from CuPy. There's an issue open to add that feature to CuPy cupy/cupy#589.

@mrocklin

@jakirkham

This comment has been minimized.

Copy link
Member

commented Mar 6, 2019

FWIW raised issue ( numpy/numpy#13100 ) to see if fix and a few other functions could be converted to ufuncs, which would be one way to solve this. Please feel free to join the discussion over there if it is of interest.

@pentschev

This comment has been minimized.

Copy link
Member Author

commented Mar 6, 2019

Thanks @jakirkham, I've subscribed for notifications, I'll join if I can help with something. :)

@jakirkham

This comment has been minimized.

Copy link
Member

commented Mar 18, 2019

Just in case it is needed, here's a workaround.

np.where(a < 0, np.ceil(a), np.floor(a))

CuPy does implement where, which could be dispatched to via NEP 18. Also ceil and floor are both ufuncs, which already dispatch through the __array_ufunc__ protocol.

@pentschev pentschev referenced this issue Apr 24, 2019

Open

NEP-18 Issue Tracking #4731

9 of 17 tasks complete
@pentschev

This comment has been minimized.

Copy link
Member Author

commented May 21, 2019

Closing this, since #4708 was merged already.

@pentschev pentschev closed this May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.