Skip to content

Implement __array_function__ interface#1650

Merged
takagi merged 2 commits intocupy:masterfrom
okuta:implement-array-function-interface
Jan 8, 2019
Merged

Implement __array_function__ interface#1650
takagi merged 2 commits intocupy:masterfrom
okuta:implement-array-function-interface

Conversation

@okuta
Copy link
Member

@okuta okuta commented Sep 15, 2018

Close #1322
Please see discussion numpy/numpy#11129 numpy/numpy#12028.

@okuta okuta added the cat:feature New features/APIs label Sep 15, 2018
Copy link

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

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

Just a small bug in your implementation.

@okuta
Copy link
Member Author

okuta commented Sep 17, 2018

@hameerabbasi I want to try with NumPy. Do you have an implementation of NEP 18?

@shoyer
Copy link

shoyer commented Sep 17, 2018

We don't have any implementation of NEP 18 yet, beyond the proof of concept implementation referenced in the NEP (which doesn't actually implement the NumPy API).

@okuta
Copy link
Member Author

okuta commented Sep 18, 2018

OK, I am waiting it.

@okuta
Copy link
Member Author

okuta commented Oct 21, 2018

Please read numpy/numpy#12028.

@shoyer
Copy link

shoyer commented Oct 26, 2018

The development branch of numpy now has support for __array_function__. It would be great if you could give this a try and report back any issues!

@okuta
Copy link
Member Author

okuta commented Oct 30, 2018

Thanks, I will try it.

@okuta
Copy link
Member Author

okuta commented Oct 30, 2018

This PR is working with NumPy master branch. @shoyer

import numpy
import cupy

a = cupy.arange(10).reshape(2,5)
print(numpy.argmax(a))         #=> array(9)
print(numpy.argmax(a,axis=0))  #=> array([1, 1, 1, 1, 1])

@okuta okuta force-pushed the implement-array-function-interface branch from 8ffa4cd to 7634174 Compare December 24, 2018 11:57
@okuta okuta changed the title [RFC] Implement __array_function__ interface Implement __array_function__ interface Dec 24, 2018
@takagi takagi self-assigned this Dec 25, 2018
@takagi takagi added this to the v6.0.0b2 milestone Jan 8, 2019
@takagi
Copy link
Contributor

takagi commented Jan 8, 2019

LGTM! I suppose that it is reasonable to merge this feature soon as __array_function__ will be experimentally supported since comming NumPy 1.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:feature New features/APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants