-
Notifications
You must be signed in to change notification settings - Fork 315
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
Implement to_device() for python bindings, add unit tests #1611
Implement to_device() for python bindings, add unit tests #1611
Conversation
I don't know if the failure to build win wheels is related or not. Logs does not seem to provide anything useful. OK found it: pypa/cibuildwheel#1741 |
Hi @minhthuc2502 , would it be possible to review this? |
Could you fix the pipeline please? |
Yes, I'll look at it now |
I just merged |
ok apparently this was a glitch in the build process rather than an issue in the PR itself. |
LGTM! Thanks for your PR! |
Thanks! Do you have any plans of doing a release soon? |
We will do the release ASAP |
This will fix the issue #1575
ctranslate2.Device
enum to Pythonto_device()
method that wraps the overloadedStorageView::to()
variantCaveats:
.to_device(Device.cpu)
seems to create a copy of the backing store. I added anif ()
on the C++ side but didn't seem to work. I'm not super familiar with C++ and pybind so maybe there's a way to just reflect back the tensor/storage itself in that case.