Skip to content
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

Numpy 2.x breaks htm.SDR #1019

Closed
fcr opened this issue Sep 2, 2024 · 4 comments · Fixed by #1020
Closed

Numpy 2.x breaks htm.SDR #1019

fcr opened this issue Sep 2, 2024 · 4 comments · Fixed by #1020

Comments

@fcr
Copy link
Collaborator

fcr commented Sep 2, 2024

htm.core SDR does not behave correctly with numpy 2.x regardless whether built with numpy 1.x or numpy 2.x

If the attached test program is run with numpy 1.x it prints the correct result for a sparse SDR, namely [609 641 672 704 705 706 738 739 802]

if it is run with numpy 2.x it gives the incorrect result of [609 609 609 609 609 609 609 609 609]
run_numpy_test.py.zip

@ctrl-z-9000-times
Copy link
Collaborator

Okay, clearly the time has come for us to support numpy v2.

I think the first step is to upgrade our pybind11 depenency from version 2.10 to at least 2.12 which claims to support numpy-v2.

https://pybind11.readthedocs.io/en/stable/upgrade.html

@ctrl-z-9000-times
Copy link
Collaborator

Hi fcr,

I made a branch "numpy-v2" and pull request #1020 which should fix this issue.
Give it a try! Make sure to do a clean build for this branch, I had to uninstall & reinstall the htm.core python package to get it to work.

This turned out to be a very simple fix, I probably should have done it months ago...

@dkeeney
Copy link

dkeeney commented Sep 2, 2024

Thanks ctrl-z-9000-times for taking care of this. I was busy one another project and did not get to it right away. Oh, and thanks fcr for point it out.

@fcr
Copy link
Collaborator Author

fcr commented Sep 2, 2024

Hi @dkeeney ,
I checked the pull request and it works on my Mac.
Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants