-
Notifications
You must be signed in to change notification settings - Fork 347
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
Add support for moving PyTorch Tensors from python to rust via PyO3 #698
Add support for moving PyTorch Tensors from python to rust via PyO3 #698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
I have just tested it as well. Works well.
I have highlighted a few parts I may have accidentally left behind.
Cargo.toml
Outdated
|
||
[dev-dependencies] | ||
anyhow = "1" | ||
|
||
[workspace] | ||
members = ["torch-sys"] | ||
members = ["torch-sys", "examples/python-entropy"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
examples/python-entropy/main.py
Outdated
# eye = torch.eye(3) | ||
# eye.grad = torch.ones(3, 3) | ||
# print('aaaaa') | ||
# eye2 = pe.print(eye) | ||
# print(eye) | ||
# print('eye2') | ||
# print(eye2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part can be deleted. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! Hope we can merge this today @LaurentMazare?
I've pushed a more barebone sets of changes that should hopefully make it possible to write python extensions using |
All Credit goes to @egordm
@LaurentMazare Please let us know what you need from us to merge this, we urgently need this functionality
Updated version of #457
Merged changes and added macOS support (dylib)