-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
invalid result on master when aggregating flat array with size=0 #846
Comments
Is it specific to the use of |
@pitrou Good question. Here is my
|
This maybe a numpy bug. Consider: import numpy as np
import numpy.core.umath_tests as ut
x = np.arange(0.0).reshape(2, 0)
y = np.arange(0.0).reshape(0, 2)
print(x, x.shape, x.data.nbytes)
print(y, y.shape, y.data.nbytes)
print(ut.matrix_multiply(x, y)) which prints:
|
Interesting. I should note that this does work on the numba 0.15.1 (I accidentally omitted that in my original report), so it is likely related to work refactoring Also might be related to this numpy issue: numpy/numpy#5195 |
The fact that it works with |
@pitrou I tried inserting some print statements, but of course that causes the function to be executed in python mode, which removes the bug. |
If you use the print() function and only print integers and floats, the function should be able to compile in nopython mode (add nopython=True to the jit() call to ensure this). |
OK, perhaps this output may be helpful: import numpy as np
from numba import guvectorize
@guvectorize(['void(float64[:, :], float64[:])'],
'(x, y)->()', nopython=True)
def my_sum(a, out):
asum = 0.0
print(asum)
adding = 99999999 # some sentinel value
for n, ai in enumerate(a.flat):
print(adding)
print(ai)
asum += ai
print(asum)
out[0] = asum
for shape in [(0, 0), (0, 2), (2, 0)]:
print('\nshape {}:'.format(shape))
x = np.arange(0.0).reshape(shape)
print repr(my_sum(x))
It looks like |
Thank you. Yes, it's an issue with |
…rrays with a non-zero dimension size.
I'm running the master version of numba (actually 0.15.1-28-g2f5d025) and numpy 1.9.0 on Python 2.7/OSX (via conda).
This is indeed pathological data, but this part of the bottleneck test suite failed when I tested it for numbagg.
The text was updated successfully, but these errors were encountered: