-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 of const fused type memory views #3118
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.
Thanks, I left some comments.
PR updated to use |
Change looks perfect, but yes, more tests for |
Added a few tests of |
Thanks! |
Wow nice! Thanks a lot for this, this is something we needed in scikit-learn for some time. I'll try to get someone to try this out in scikit-learn and give feed-back. |
This problem was addressed by cython/cython#3118 which first was released in Cython 0.29.33: https://cython.readthedocs.io/en/latest/src/changes.html#id80 Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
This PR is related to #1772 and is an attempt at supporting
const
fused type memory views such as:Cython internals are new to me, so I don't know how far this is from a proper solution, but it's working fine from what I tested.
Let me know if it is worth spending more time on it and what can be improved.
One remark: In case of function signature like
def test(const cython.floating[:] a, cython.foating[:] b)
and mismatching input floating types, the exception is:TypeError: No matching signature found
while without
const
it is:ValueError: Buffer dtype mismatch, expected 'float' but got 'double'
Closes #1772.