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
Support order=
in ndarray bound function reshape
.
#5435
Comments
Thanks for the report. Please could you provide more information about what caused this problem:
Once we have a reproducer someone can take a look and work on a fix. Thanks for your help. |
Sure!
|
@TomMaullin thanks for submitting the code to run the example. For convenience, I have patched up a self contained runnable version, (including imports). As a recommendation for the future, if you can provide such an example that we can copy and paste it makes debugging much quicker and easier. from numba import njit
import numpy as np
@njit
def permOfIkKkI2D(k1,k2,n1,n2):
# First we need the permutation represented by matrix K in vector format
permP = np.arange(n1*k2).reshape((n1, k2), order='F').ravel()
# Now we work out the permutation obtained by the first kronecker product (i.e. I kron K)
permKron1 = np.repeat(np.arange(k1),n1*k2)*n1*k2+np.tile(permP,k1)
# Now we work out the final permutation by appplying the second kronecker product (i.e. I kron K kron I)
p = np.repeat(permKron1,n2)*n2+np.tile(np.arange(n2),n1*k1*k2)
# Return the permutation
return(p)
# Generate random numbers
n1=np.random.randint(1,10)
n2=np.random.randint(1,10)
k1=np.random.randint(1,10)
k2=np.random.randint(1,10)
# Work out the permutation
perm = permOfIkKkI2D(k1,k2,n1,n2) Also, I can reproduce this locally but not yet sure what the problem is, so I will label it as needing triage. |
Doing:
the:
is the important bit. The bound function |
order=
in ndarray bound function reshape
.
Updated title and made into feature request. |
Reporting a bug
the change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
I have written the following function, which works out a permutation I need for my code, it works well without
numba
but fails with it.With
numba
I get this error:The text was updated successfully, but these errors were encountered: