We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have the following helper function to vectorize a 2D matrix. If I run it without numba it works well.
numba
def mat2vec(matrix): #Return vectorised matrix return(matrix.transpose().reshape(matrix.shape[0]*matrix.shape[1],1)) # Example: matrix = np.random.randn(3,3) print(matrix) print(mat2vec(matrix))
If I run it with @numba.jit(nopython=True) prepended to the function I get:
@numba.jit(nopython=True)
--------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) <ipython-input-46-bce81c0a0a5c> in <module>() 8 matrix = np.random.randn(3,3) 9 print(matrix) ---> 10 print(mat2vec(matrix)) NotImplementedError: incompatible shape for array
Apologies if this is documented behaviour/a non-issue and I have misunderstood but I cannot work out why this happens.
The text was updated successfully, but these errors were encountered:
Confirmed bug. The reshape on the original non-transposed matrix works fine. Seems to be a logic error when the layout is changed.
Sorry, something went wrong.
No branches or pull requests
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).
Bug
I have the following helper function to vectorize a 2D matrix. If I run it without
numba
it works well.If I run it with
@numba.jit(nopython=True)
prepended to the function I get:Apologies if this is documented behaviour/a non-issue and I have misunderstood but I cannot work out why this happens.
The text was updated successfully, but these errors were encountered: