-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
torch.unique not support for torch.jit.script #37986
Comments
|
it would be a similar to #33737
|
Summary: Fix for #37986 Follows the stack in #33783 stack to make functions in `torch/functional.py` resolve to their python implementations. Because the return type of `torch.unique` depends on `return_inverse` and `return_counts` I had to refactor the implementation to use our boolean_dispatch mechanism. Pull Request resolved: #38156 Differential Revision: D21504449 Pulled By: eellison fbshipit-source-id: 7efb1dff3b5c00655da10168403ac4817286ff59
Summary: Fix for pytorch#37986 Follows the stack in pytorch#33783 stack to make functions in `torch/functional.py` resolve to their python implementations. Because the return type of `torch.unique` depends on `return_inverse` and `return_counts` I had to refactor the implementation to use our boolean_dispatch mechanism. Pull Request resolved: pytorch#38156 Differential Revision: D21504449 Pulled By: eellison fbshipit-source-id: 7efb1dff3b5c00655da10168403ac4817286ff59
Summary: Fix for #37986 Follows the stack in #33783 stack to make functions in `torch/functional.py` resolve to their python implementations. Because the return type of `torch.unique` depends on `return_inverse` and `return_counts` I had to refactor the implementation to use our boolean_dispatch mechanism. Pull Request resolved: #38156 Differential Revision: D21504449 Pulled By: eellison fbshipit-source-id: 7efb1dff3b5c00655da10168403ac4817286ff59
🚀 Feature
Add
torch.unique
support totorch.jit.script
so that it is possible to jit-script graph pooling in using pytorch geometric.This was mentioned back in #12206.
@suo
Motivation
I am writing models using pytorch_geometric that I would like to jit-script. I have started by making automatic GNN model synthesis that makes jittable convolution operations, but we also need to do graph pooling to have the full range of functionality. This latter bit requires
torch.unique
in python to be jit-scriptable.Pitch
I would like:
to not result in:
but rather a working jit function!
Alternatives
Writing everything in C++ for torch_geometric, which is a significant time burden for developers, where this could be fixed easily and centrally.
Additional context
This is supporting an effort here:
pyg-team/pytorch_geometric#1191
to make pytorch_geometric easily jittable without major rewrites or changes of user code.
cc @suo
The text was updated successfully, but these errors were encountered: