Skip to content Skip to sidebar Skip to footer

Find Numpy.int_ In Array Of Int_s Using Numba

I am using numba (0.10.2-5-gda3e2bb-dirty) to speed up my code. Now I am trying the following: from numba import void, int_, double, jit import numpy as np @jit class bla(object)

Solution 1:

There are a number of basic issues with your code syntax (indentation, missing parentheses, etc.), but if I re-write it as follows, I an error message that in type comparisons are not implemented yet:

NumbaError: (see below)
--------------------- Numba Encountered Errors or Warnings ---------------------
Error <class'_ast.In'> comparisons not yet implemented
--------------------------------------------------------------------------------

import numpy as np
from numba import void, int_, double, jit

@jitclassbla(object):
    @void()def__init__(self):
        self.x = 1    @void()defmy_fun(self):
        self.x = 1
        k = np.int_(1)
        f = np.int_(np.array([1, 2 , 3, 4, 5]))
        if k in f:
            print'aaa'

I had to throw in the self.x lines because numba seems to fail on compile with unused variables, including self.

Post a Comment for "Find Numpy.int_ In Array Of Int_s Using Numba"