You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import numba
import numpy as np
@numba.jit(nopython=False)
def cross_issue(a=None):
if a is None:
a = 1
np.sum([1, 2, 3])
return a
print(cross_issue())
Expected result
after the if statement a should be 1, however the function returns None.
The behavior doesn't show up if the call to np.sum is removed. The weird behavior is also present with other functions (I originally discovered it with np.cross and saw it with np.mean too).
I have honestly no idea how this even can be or how to debug it. Suggestions are welcome.
The text was updated successfully, but these errors were encountered:
cosama
changed the title
numpy calls interfere with external code in nopython=True functions
numpy calls interfere with external code in nopython=True functions
Mar 27, 2019
cosama
changed the title
numpy calls interfere with external code in nopython=True functions
numpy calls interfer with external code in nopython=True functions
Mar 27, 2019
cosama
changed the title
numpy calls interfer with external code in nopython=True functions
numpy calls interfere with external code in nopython=True functions
Mar 27, 2019
Thanks for the report. What you are seeing is most likely due to this bug: #3879 which was fixed here: #3883, the recently released Numba 0.43.1 fixes this problem, perhaps try updating your Numba installation:
System
python 3.7
with:Minimal example
Expected result
1
, however the function returnsNone
.np.sum
is removed. The weird behavior is also present with other functions (I originally discovered it withnp.cross
and saw it withnp.mean
too).The text was updated successfully, but these errors were encountered: