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

CupyBackend matrices are np.ndarrays #196

Open
BrunoLiegiBastonLiegi opened this issue Dec 18, 2024 · 0 comments
Open

CupyBackend matrices are np.ndarrays #196

BrunoLiegiBastonLiegi opened this issue Dec 18, 2024 · 0 comments

Comments

@BrunoLiegiBastonLiegi
Copy link
Contributor

While working on qiboteam/qibo#1548 I noticed that if you try to get the matrices from the CupyBackend, namely:

from qibojit.backends import CupyBackend

b = CupyBackend()
print(type(b.matrices.X))

you get a np.ndarray rather than a cp.ndarray. This does not seem to be the case for other backends that do not have np.ndarray as native arrays, e.g. PyTorchBackend or Tensorflowbackend.
I was wondering what was the reason behind this, because this makes some things in qiboteam/qibo#1548 more annoying, requiring for you to explicitely cast to cupy arrays when needed.

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

1 participant