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
use of @jit and @njit makes function execute with false output #6247
Comments
Are you expecting this to print
If you get |
I cant run
gives me reinstalled numba and still get a false :( |
That's the current version, you're correct.
I have tried in a fresh conda environment on Windows: conda create -n numba512 python=3.8 numba=0.51.2
conda activate numba512
numba -s
# ... Produces a summary of the system
python issue-6247.py
# prints "True" How are you installing Numba? If you create a new virtualenv or conda env and install Numba into that, do you get a |
I dont use conda, since it always slows down my whole computer. (gave it a few tries), instead use spyder (created a shortcut). There seems to be a bug, so i reinstalled python completely and got the same(python 3.7) .
in the line in which |
It looks like there's still something mixed up about your Python / Numba installation. How did you reinstall Python? How are you using Spyder? (I don't use Spyder, but my limited understanding is that it's an IDE, rather than a package manager, so I'm not sure how Spyder is something you can use instead of conda). |
I just did I reinstalled python by deleting executing a normal windows deinstallation on python and the python laucher. |
If you do:
What is the output? |
|
reinstalled python again, this time i looked for any single folder in the appdata folder. now it works on 3.8 |
@La-Li-Lu-Le-Loa thanks for reporting back, happy it works for you now. |
Reporting a bug
visible in 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).
The sample data used are lists of arrays, which have the same size of the subarrays at the same index,
but a totally different size in the other indices. Therefore the inputs to func3() are converted to a numpy array of objects before passing them to
func3()
.Inside
fun3()
an empty numpy array (of exactly the same shape as the passed arrays) is created.The array's subarray's elements will be "filled" with (or changed to)
0
s or1
s depending on the first occouring condition.This array will be returned.
My interpretation is, that at least the conditional part is completely ignored when
@jit
decorators are used.I also included the "old" function (a list comprehension) which is a little slower but creates the correct output and a comparison funciton, to make things easier for us.
This could be a bug or false usage of the
@jit
decorator (though i reseached before opening this issue, but please excuse if the latter could be the case)The text was updated successfully, but these errors were encountered: