-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Population Count Op #36380
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
Comments
Any update or workaround here? |
I will express interest too, since NumPy is about to add
Now, if we proceed to GPU, I have the following:
The code I work on daily is quite specific and there I use |
Quick update: I think the fact that numpy added it is a good signal that we want it as well for best compatibility. |
I am strongly in support of including |
Throwing this in here in case it helps anyone. Torch bit packing and packed tensor counting. Went through a few iterations to create a performant solution. I'm in support of this features inclusion natively, but here's a working solution in the mean time. (Requires you to flatten before bit packing.)
|
Uh oh!
There was an error while loading. Please reload this page.
🚀 Feature
It would be great to have the bitwise operation 'Population Count' that counts the number of 1 bits to be exposed.
Not sure if this exists in the back end of torch? It is exposed in tensorflow
Motivation
This is a key operation in implementing binarised neural nets, for example in XNOR-Net. Binarised linear and conv layers can be performed quickly using XNOR and population counts. XNOR is already exposed in the pytorch API.
cc @albanD
The text was updated successfully, but these errors were encountered: