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

Make use of numpy/cupy consistent #9

Open
benrobby opened this issue Mar 28, 2022 · 0 comments
Open

Make use of numpy/cupy consistent #9

benrobby opened this issue Mar 28, 2022 · 0 comments

Comments

@benrobby
Copy link
Collaborator

Currently, we use numpy/np and cp/cupy very inconsistently.

In fact, for example for the types, a lot of cupy types are just aliases to numpy.
https://docs.cupy.dev/en/stable/reference/comparison.html#numpy-cupy-apis
(search for numpy.float_)
cp.float_ is apparently only an alias to numpy.float_

My gut feeling would be: Always use numpy, except in cases where really something on the gpu is happening, like cp.max or so (so "real" cupy functions), but opening this to discuss this behaviour.

Toms inituition would be: numpy types for numpy functions and cupy types for cupy functions. Whoever reads the code is probably not that familiar with cupy to know this are only aliases and wonders that cupy takes numpy types.

But even so I do not have that strong of an opinion regards this topic, as long as we do it consequently.

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

No branches or pull requests

1 participant