我可以在0.6 numba文档中找到有关如何使用
numba on classes的一些信息:
from numba import jit, void, int_, double
# All methods must be given signatures
@jit
class Shrubbery(object):
@void(int_, int_)
def __init__(self, w, h):
# All instance attributes must be defined in the initializer
self.width = w
self.height = h
# Types can be explicitly specified through casts
self.some_attr = double(1.0)
@int_()
def area(self):
return self.width * self.height
@void()
def describe(self):
print("This shrubbery is ", self.width,
"by", self.height, "cubits.")
但我没有在0.16 documentation找到.是否总是可以在课堂上使用numba?