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.ndarray.copy() incorrect when operating on less common array layouts #3557
Comments
Thanks for the report. I think the problem is with Numba's import numpy as np
from numba import njit
def transp(a):
return a.transpose(1, 0, 2)
def transp_copy(a):
return a.transpose(1, 0, 2).copy()
x = np.arange(24).reshape(2, 2, 6)
def test(fn):
print("Testing %s" % fn.__name__)
np.testing.assert_allclose(fn(x), njit(fn)(x))
print("ok\n")
if __name__ == "__main__":
test(transp)
test(transp_copy) gives:
|
Thanks a lot for this quick answer. |
@QB3 no problem. Title updated and the sample in #3557 (comment) is sufficient thanks. I'm slightly suspicious that once the copy is fixed that the reshape will also need attention. |
On mainline for 0.55, neither the OP reproducer or that in #3557 (comment) reproduces any more. Closing assume fixed. |
Description
The combination of transpose + reshape operations gives different results in numba and numpy.
The text was updated successfully, but these errors were encountered: