Add support of const fused type memory views#3118
Conversation
scoder
left a comment
There was a problem hiding this comment.
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
constfused 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 foundwhile without
constit is:ValueError: Buffer dtype mismatch, expected 'float' but got 'double'Closes #1772.