Numba V0.44: Cannot Reflect Element Of Reflected Container
I am new to numba and am struggling at every turn to get what I think is simple to work in nopython mode. For example, inspired by this question coalescing-ranges I have written t
Solution 1:
Numba now offers Typed Lists, these accept a list of lists. As far as I can see they still need to be appended individually though (because the TypedList.extend method doesn't accept LofL). This leads to:
from numba.typed import List # As per the docs, since it's in beta, it needs to be imported explicitly
lol = [[1, 10, 100], [0, 50, 75], [1, 50, 150], [0, 10, 100], [0, 200, 300], [0, 15, 150]]
nb_list = List()
for lst in lol:
nb_list.append(lst)
coalesce(nb_list)
Solution 2:
Numba as of 0.44 does not support list of lists as inputs to functions in nopython
mode. See:
http://numba.pydata.org/numba-doc/latest/reference/pysupported.html#list-reflection
The warnings you are seeing when using jit
are related to the fact that falling back to object mode, but in future releases of numba, this will raise an error rather than falling back. See:
If you can convert your input to a 2D numpy array, then you can get around this limitation.
Post a Comment for "Numba V0.44: Cannot Reflect Element Of Reflected Container"