-
Notifications
You must be signed in to change notification settings - Fork 520
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
boolean indexing ops: AtenNonzeroOp, AtenIndexTensorOp, AtenMaskedSelectOp #3293
Comments
Hi @renxida, are you still working on these ops? |
Abandoned them before becasue thought they weren't important. Just got a message from Dhiraj that these are important. Hopping on them. |
using some logic from 33f9101 |
some prototyping work. i implemented the decomposition in python and tested them against pytorch https://colab.research.google.com/drive/1j724QyrwrZojEoBnng6w87LADLGvlb6i#scrollTo=3vEqg6uopswY and this code exports the ir for my prototypes: i had to use torchscript because fx doesn't allow slicing with tensor_a[:sum(tensor_b). this would probably be a problem later. |
Ops that need work:
All of the above ops decompose to indexing with a Boolean tensor
The key thing I can't figure out for these ops right now is that I really need a way to shorten something like
to
some kind of list filtering, basically.
If I have any one of the above ops, I would be able to decompose the rest to it. Indexing seems the most canonical choice.
How to implement bool indexing
I'm thinking just using a scf for loop to append to a list, then convert to a variable-length tensor. There are some nuances there and I should probably read this discussion with Ben and Quinn to figure it out https://discord.com/channels/973663919757492264/1172976577924050984/1220489866161295440
The text was updated successfully, but these errors were encountered: