【问题标题】:numba argument argtypes deprecated keywordnumba 参数 argtypes 不推荐使用的关键字
【发布时间】:2016-10-06 07:48:40
【问题描述】:

当我输入以下代码时:

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 并重新输入 @jit 装饰器的参数。

请帮我解决这个问题。

【问题讨论】:

    标签: python numba


    【解决方案1】:

    错误消息告诉您它的预期

    Signatures should be passed as the first positional argument.
    

    所以不是

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

    它们应该是位置的

    numba.jit(uint32(float32, float32, uint32))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-03
      • 1970-01-01
      • 1970-01-01
      • 2011-02-17
      • 1970-01-01
      相关资源
      最近更新 更多