numba argument argtypes已弃用的关键字

时间:2016-10-06 07:48:41

标签: python numba

当我输入以下代码时:

mandel_numba = numba.jit(restype=uint32, argtypes=[float32, float32, uint32])(mandel)

并收到错误消息

 raise DeprecationError(_msg_deprecated_signature_arg.format('argtypes'))
numba.errors.DeprecationError: Deprecated keyword argument `argtypes`. Signatures should be passed as the first positional argument.

我的numba版本是0.28.0,我知道numba 0.18版本删除了旧的已弃用且未记录的argtypes和restype参数给@jit装饰器。

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

错误消息告诉您它的期望

Signatures should be passed as the first positional argument.

所以而不是

numba.jit(restype=uint32, argtypes=[float32, float32, uint32])

他们应该是位置

numba.jit(uint32(float32, float32, uint32))
相关问题