开发者

How can I intentionally create a non-aligned numpy array?

开发者 https://www.devze.com 2023-01-24 05:18 出处:网络
I need to intentionally create a non-aligned numpy array. In particular, I want PyArray_ISALIGNED(array) to return false. What causes numpy arrays not to be aligned, and how can I easily, manually tri

I need to intentionally create a non-aligned numpy array. In particular, I want PyArray_ISALIGNED(array) to return false. What causes numpy arrays not to be aligned, and how can I easily, manually trigger tho开发者_C百科se conditions?


I don't know the details, there is a test in scipy.linalg that checks that misaligned arrays don't cause an error with Lapack.

http://projects.scipy.org/scipy/browser/trunk/scipy/linalg/tests/test_decomp.py?rev=#L1065

However, if you search scipy tickets, you see that there are some problems across various platforms.

0

精彩评论

暂无评论...
验证码 换一张
取 消