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

Injecting does not work for cupy #4

Open
thomasjpfan opened this issue Apr 21, 2020 · 1 comment
Open

Injecting does not work for cupy #4

thomasjpfan opened this issue Apr 21, 2020 · 1 comment

Comments

@thomasjpfan
Copy link
Contributor

When trying to inject the array module:

dummy.inject_array_module(cupy.ndarray, (np.ndarray, dummy.DummyArray,),
                          module=cupy)

the following error appears:

numpy_dispatch/dummy.py in inject_array_module(arrtype, known_types, module)
    147         return NotImplemented
    148 
--> 149     arrtype.__array_module__ = __array_module__
    150 

TypeError: can't set attributes of built-in/extension type 'cupy.core.core.ndarray'
@seberg
Copy link
Owner

seberg commented Apr 21, 2020

Ah, no, it will only work for things written in Python... its dirty for a reason :). Maybe I need some hack to support types without modifying the actual type (i.e. a dictionary type -> __array_module__ function) if just for testing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants