我试过这个:
import numpy as np
import numba
@numba.jit
class foo(object):
@numba.void(numba.int32)
def __init__(self, somenum):
self.somenumarray = np.arange(somenum)
@numba.jit('f8[:](f8[:])')
def somemethod1(self, a):
return self.somenumarray + a
使用@numba.double[:](numba.double[:])
方法装饰器会导致错误。